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 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

Log in to vote
0
Answered by 8 years ago

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)

0
You know you can edit the original question, right? M39a9am3R 3210 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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)


0
I did the check yet it still doesn't work. swimmaster07 25 — 8y
Log in to vote
0
Answered by
Dr_Doge 100
8 years ago

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.

0
yes when i do this it shows my animation. swimmaster07 25 — 8y
0
you gunna help or naw?! swimmaster07 25 — 8y

Answer this question