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

My animation wont play when i have equipped it but when i unequip it plays?

Asked by 7 years ago
plr = game.Players.LocalPlayer
mouse = plr:GetMouse()
char = plr.Character
tool = script.Parent
animation = Instance.new("Animation",script.Parent.Screen)
animation.AnimationId = "rbxassetid://729367460"
trackanim = nil
tool.Equipped:connect(function()
    trackanim = char.Humanoid:LoadAnimation(animation)
    trackanim:Play()
    trackanim.KeyframeReached:connect(function()
        local Gui = Instance.new("SurfaceGui",script.Parent.Screen)
        local Frame = Instance.new("Frame")
        Frame.Size = UDim2.new(1,0,1,0)
        local T1 = Instance.new("TextLabel",Frame)
        T1.Size = UDim2.new(0,100,1,0)
    end)
end)

is the code

Answer this question