warn("Loading... ")
wait(0.025)
warn("Loaded!... ")
local anim = script.Punch
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char.Humanoid
script.Parent.Activated:Connect(function()
local animloaded = hum:LoadAnimation(anim)
animloaded:Play()
-- im tired please help
COMMUNITY QUESTION
Why is the animation broken and not working? What am I doing wrong?
1 answer
Try This:
warn("Loading... ")
wait(0.025)
warn("Loaded!... ")
local Anim = script:WaitForChild("Punch",10) --Crash Reason???
local Plr = game:GetService("Players").LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local Hum = char.Humanoid
script.Parent.Activated:Connect(function()
local AnimLoaded = Hum.Animator:LoadAnimation(Anim) --hum:LoadAnimation is Decipricated so you refer to the animator instead
AnimLoaded:Play()
end)
Put WaitForChild when trying to find the animation, because as soon as studio starts, it needs time to load
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This is a local script; that is placed in the StarterPack