Dynamic Variable in LUA command question

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Dynamic Variable in LUA command question

Post by nathanj »

Hi Tony,

Hopefully this is an easy question.

With UCC PUN all player's are tagged "Player" by default so if I leave the LUA command for uccAddItem("","Item",1) it serches for all of the objects tagged "Player". Because this is multiplayer each player in the room gets the item.

So, I'm trying to assign a dynamic variable that allows only the intended character to recieve the items, but I'm a little stuck for some reason.

Can you see why this isn't working? I should note that the " [var=PlayerName]" works correctly in the Dialogue Field. It's just that in the LUA command "Variable("PlayerName")" is not.

Image

Thank you,
Nathan
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dynamic Variable in LUA command question

Post by nathanj »

Epic Facepalm,

Sorry.

[] not ()

Code: Select all

uccAddItem(Variable["PlayerName"], "Axe", 1);
uccAddItem(Variable["PlayerName"], "Spear", 1);
uccAddItem(Variable["PlayerName"], "Club", 1)
works
Post Reply