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!!!
You're looking for an object with the name "plyr" and not the object with the name of the value of the variable plyr
. Instead, write char=workspace:FindFirstChild(plyr)