Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my animation button only work in studios?

Asked by 5 years ago
Edited 5 years ago

After many attempts I finally found a script that works in studio, but not in game? This is the script -

local animation=Instance.new("Animation")
animation.AnimationId="http://www.roblox.com/Asset?ID=2208574099"

local trackanimation=nil
local playability=true
function playAnimation(AnimationSource)
    if playability==true then
        local plr=game.Players.LocalPlayer
        trackanimation=plr.Character.Humanoid:LoadAnimation(animation)

        trackanimation.KeyframeReached:connect(function()
            print("Working")
        end)
        trackanimation:Play()
    end
end
script.Parent.MouseButton1Click:connect(playAnimation)````
0
...What scripts have you tried? Pojoto 329 — 5y
0
Try using a R6 animation and not R15. B_rnz 171 — 5y

Answer this question