thezotikrus Posted June 7, 2019 Share Posted June 7, 2019 (edited) Wasted some time by myself, but didn't find the solution. I need your help. Idea: Using player name in character speech. This is what I got local describe = "XXX" AddPlayerPostInit(function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst:DoTaskInTime(0.1, function(inst)--no idea print(inst:GetDisplayName()) describe = inst:GetDisplayName() print(describe) -- inst.components.talker:Say("~~~") end) end) STRINGS.CHARACTERS.BILLY.DESCRIBE.MULTIPLAYER_PORTAL = "This is portal, "..describe Not really sure if its ok to get player's name this way. At least this part works fine. For some reason var describe doesn't set new value to speech string (but it surely gets it, I tested it with print).So instead "This is portal, playername", Im getting "This is portal, XXX" Edited June 11, 2019 by TheZotikRus Link to comment Share on other sites More sharing options...
Ultroman Posted June 11, 2019 Share Posted June 11, 2019 Why not simply put STRINGS.CHARACTERS.BILLY.DESCRIBE.MULTIPLAYER_PORTAL = "This is portal, "..describe into the DoTaskInTime call? Link to comment Share on other sites More sharing options...
thezotikrus Posted June 11, 2019 Author Share Posted June 11, 2019 Yay! That is how it looks like if someone need it: GLOBAL.MOD_BILLY = {} GLOBAL.MOD_BILLY.PLAYERNAME = "" AddPlayerPostInit(function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst:DoTaskInTime(0.1, function(inst) GLOBAL.MOD_BILLY.PLAYERNAME = inst:GetDisplayName() STRINGS.CHARACTERS.BILLY.DESCRIBE.MULTIPLAYER_PORTAL = "This is portal, "..GLOBAL.MOD_BILLY.PLAYERNAME end) end) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now