I am making a script, to find a certain object it needs to use a global variable in it (plyr)! How can I get it to use that variable? Here is that part of my script
print("loading")
plyr = script.Parent.Parent.Parent.Name
print(plyr)
char = workspace.plyr --this little guy!
anim = char.Humanoid:LoadAnimation(animation)
Fixed
print("loading")
plyr = script.Parent.Parent.Parent.Name
print(plyr)
char = workspace[plyr] --this little guy!
anim = char.Humanoid:LoadAnimation(animation)
Please help!!! Thank you!!!

1 comment
you could easily find the character by writing "script.Parent.Parent.Parent.Character" if "plyr" is set to the value of the player's Name property.