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

Why aren't my animations playing when I upload my game to roblox?

Asked by 8 years ago

So in starterpack i have a tool, and in the tool, theres this localscript that plays animations when the tool is activated. For some reason this code works perfectly fine in studio play solo mode, but once I upload it to roblox and play it, the animations don't play. Help?!

local tool = script.Parent
local player = game.Players.LocalPlayer
local animationtrack
local animation = tool.Folder.Animation
local animationtwo = tool.Folder.Animation2

local debounce = false

tool.Activated:connect(function()
    if debounce == false then
    debounce = true
    local c = player.Character
    local h = c:WaitForChild("Humanoid")
    animationtrack = h:LoadAnimation(animationtwo)
    animationtrack:Play()
    wait(.7)
    animationtrack:Stop()
    debounce = false 
end
end)

tool.Unequipped:connect(function()
    animationtrack:Stop()
end)
0
is this a local script? Bubbles5610 217 — 8y

Answer this question