I tried this script, but it wasn't working. Please Help!
if script.Parent.PlayOverhead.Value == true then game.Players.LocalPlayer:WaitForChild("Character"):WaitForChild("Humanoid") :LoadAnimation(script.Parent.OverheadAnim2) game.Players.LocalPlayer:WaitForChild("Character"):WaitForChild("Humanoid") :PlayAnimation(script.Parent.OverheadAnim2) end
Thanks!
First of all the script only runs once in the whole entire time you play the game.
For the script to check if a value is true, you want the script to load the animations only when the boolean is changed.
So we should make a changed event.
script.Parent.PlayOverhead.Changed:connect(function() if script.Parent.PlayOverhead.Value == true then game.Players.LocalPlayer:WaitForChild("Character"):WaitForChild("Humanoid") :LoadAnimation(script.Parent.OverheadAnim2) game.Players.LocalPlayer:WaitForChild("Character"):WaitForChild("Humanoid") :PlayAnimation(script.Parent.OverheadAnim2) end end)