This line doesnt work
player = script.Parent.Parent.Parent.Parent.Parent
is there a better way to locate the player who click on a button's backpack?
Plz herlp
This line doesnt work
player = script.Parent.Parent.Parent.Parent.Parent
is there a better way to locate the player who click on a button's backpack?
Plz herlp
If it's a LocalScript
player=Game.Players.LocalPlayer
Otherwise, just make sure you've counted the parents properly. The player would be equivalent to StarterGui plus one .Parent.
thanks
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Using a LocalScript you can get player using the LocalPlayer property of the Players service (player = game.Players.LocalPlayer) if you're going to get the player through parents (hierarchy) then do something like this: gui = script.Parent.Parent; player = gui.Parent
ok.. i think i understand now Thanks tho