Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this tool script running at all? Nothing works.

Asked by 4 years ago
01local plr= game:GetService("Players").LocalPlayer
02local char = ((character and character.Parent ~= nil and character) or plr.CharacterAdded:wait())
03if not char or not char.Parent then
04    character = plr.CharacterAdded:Wait()
05end
06 
07local hum= char:WaitForChild("Humanoid")
08local tool= script.Parent
09 
10 
11local Left=nil
12local Right=nil
13Left = hum:LoadAnimation(script:WaitForChild("Left"))
14Right = hum:LoadAnimation(script:WaitForChild("Right"))
15 
View all 34 lines...

I'm trying to make it so once you equip the tool then sit on a seat that has a object "Left", a left animation plays. But nothing seems to be working, any advices??

0
Are there any errors with the script? If not, then put a print statement in the beginning, and after your variables are declared to see what actually is stopping your script from running. OptimisticSide 199 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

It looks this is a local script as you are using hum:LoadAnimation (only works in localscript) and Tool.Equipped only works on a server script, so copy the code for the event (tool.equipped) into a server script and put the script into the tool.

If this is a server script then do the opposite of what I just said.

I hope this helps!

0
Alright got that sorted out, but sure thanks I'll accept answer. TinfoilbotGamer 35 — 4y
Ad

Answer this question