I’m trying to make a forsaken-like game and when i click the gui element its supposed to play an animation and enable a script.
The script enabling part works, but it isn’t animating
I’ve trying making the animation priority higher and reuploading the animation, but it isnt working.
wait(0.1)
local Animator = workspace:FindFirstChild(script.Parent.Parent.Parent.Parent.Parent.Name):FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator")
local Cooldown = script.Parent.Parent.Cooldown
local AnimatioN = script.Parent.Parent.Flop
script.Parent.MouseButton1Click:Connect(function()
if Animator then
if Cooldown.Value == 0 then
Animator.Parent.WalkSpeed = 0
wait(0)
Cooldown.Value = 15
local anim = Animator:LoadAnimation(AnimatioN)
anim.Priority = Enum.AnimationPriority.Action2
wait(0.6)
Animator.Parent.Parent:FindFirstChild("StompBoxScript").Enabled = true
wait(0.1)
Animator.Parent.WalkSpeed = 23
Animator.Parent.Parent:FindFirstChild("StompBoxScript").Enabled = false
else
print("Failed2")
end
else
print("Failed")
end
end)