For some reason when I click this button it won’t play the animation and yes the animation priory is set to to Core.
local id = script.Parent.Name
local anim = Instance.new("Animation")
anim.Parent = script.Parent
anim.AnimationId = "rbxassetid://"..id
local track = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(anim)
local db = false
script.Parent.MouseButton1Click:Connect(function()
if db == false then
db = true
track:Play()
else
db = false
track:Stop()
end
end)
while true do
wait()
for i = 1, 840 do
local irox = script.Parent.ImageRectOffset.X
local iroy = script.Parent.ImageRectOffset.Y
script.Parent.ImageRectOffset = Vector2.new(irox +0.5, iroy +0.5)
wait()
end
wait()
script.Parent.ImageRectOffset = Vector2.new(0, 0)
end