Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

So I have this animation script. It is in a local script, and the local script is under a tool. The script works fine in studio, but then once i upload my game to roblox, the animation doesn't seem to play. Help!

local tool = script.Parent local player = game.Players.LocalPlayer local animationtrack local animationtwo = tool.Folder.Animation2 local sound = tool.Sound

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() sound:Play() wait(.7) animationtrack:Stop() wait(.2) debounce = false end end)

tool.Unequipped:connect(function() animationtrack:Stop() end)

3 answers

I'm sorry here's the code...

local tool = script.Parent
local player = game.Players.LocalPlayer
local animationtrack
local animationtwo = tool.Folder.Animation2
local sound = tool.Sound

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()
	sound:Play()
	wait(.7)
	animationtrack:Stop()
	wait(.2)
	debounce = false 
end
end)

tool.Unequipped:connect(function()
	animationtrack:Stop()
end)

1 comment

0

You know you can edit the original question, right?

What i do is Check for the Humanoid and the Animation

local tool = script.Parent
local player = game.Players.LocalPlayer
local animationtrack
local animationtwo = tool.Folder.Animation2
local sound = tool.Sound

local debounce = false

tool.Activated:connect(function()
    if debounce == false then
    debounce = true
    local c = player.Character
    local a = tool.Folder:FindFirstChild('Animation2')
    local h = c:FindFirstChild("Humanoid")
    if a and h then
    local animationtrack = h:LoadAnimation(animationtwo)
    if animationtrack then
    animationtrack:Play()
    sound:Play()
    wait(.7)
    animationtrack:Stop()
    wait(.2)
    debounce = false 
end
end
end
end)

tool.Unequipped:connect(function()
    animationtrack:Stop()
end)


1 comment

0

I did the check yet it still doesn't work.

Have you tried buying the anamation? From my experience, If the animations not made by Roblox then the game owner needs to own it for it to work. Go to the library and click on a random model, then replace the ID with the anamation ID.

Tell me if this worked.

2 comments

0

yes when i do this it shows my animation.

0

you gunna help or naw?!

This discussion is preserved as it was. New answers, comments, and votes are closed.