Page 1 of 1

Dynamic Variable in LUA command question

Posted: Tue Sep 29, 2020 6:03 pm
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

Re: Dynamic Variable in LUA command question

Posted: Tue Sep 29, 2020 6:06 pm
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