I have this tool that plays animation when the tool is equipped. The animation plays in Roblox studio, but not when you’re playing the game. Does anyone know how to fix the problem?
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
local anim = h:LoadAnimation(script.Parent:WaitForChild("Animation"))
local Box = script.Parent
Box.Equipped:Connect(function()
anim:Play()
end)
Box.Unequipped:Connect(function()
anim:Stop()
end)