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

Why does the animation not play on R15 tool?

Asked by
proo34 41
4 years ago
--Makes the food etable
--Variables
script:WaitForChild("TilCashOut")

local plr = game.Players.LocalPlayer
local Char = plr.Character
local Brick = script.Parent
CanContinue = true
TilCashOut = plr.plrvalues.BricksPerCash.Value
TilCash = script.TilCashOut

--WaitForChilds
plr:WaitForChild("leaderstats")
plr:WaitForChild("plrvalues")
script.Parent:WaitForChild("EatReach")
script.Parent:WaitForChild("EatLoop")

local function onActivate()
    if CanContinue == true then
    --Animation loader, variables
    local AnimEat = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.EatReach)
    local Animloop = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.EatLoop)

    AnimEat:Play()
    if TilCash.Value == plr.plrvalues.BricksPerCash.Value then
    plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value + plr.plrvalues.PerCashOut.Value * plr.plrvalues.CashMultip.Value
    TilCash.Value = 0
    end

    TilCash.Value = TilCash.Value + 1

    script.Parent.Eating:Play()
    CanContinue = false
    Animloop:Play()
    wait(2)
    Animloop:Stop()
    script.Parent.Eating:Stop()

    plr.leaderstats.Bricks.Value = plr.leaderstats.Bricks.Value + plr.plrvalues.PerBrick.Value * plr.plrvalues.Multiple.Value

    CanContinue = true

    else
    --Do nothing
    end

end
Brick.Activated:Connect(onActivate)

I've done everything possible, I can't figure out why the animation doesn't play. Any idea?

Thanks!

0
I used this site a decent amount but recently found: https://devforum.roblox.com/c/development-support and you get a reply within like 5-10 min most likely. popu2004 42 — 4y
0
If im gonna be honest this site takes days if not weeks sometimes for a reply, still like this site but would recommend devforum instead for faster replys popu2004 42 — 4y

2 answers

Log in to vote
0
Answered by
pwx 1581 Moderation Voter
4 years ago

Have you tried checking the priority and making sure it's action so it can play whilst other animations are playing? And are you sure it's an R15 rig animation?

0
You need to download the animation to your computer, then you need to publish it to roblox. Look up how to do that if you don't know how. RobloxOplay0 0 — 4y
Ad
Log in to vote
0
Answered by
c0nc3rt 61
4 years ago

Hmm, I feel like your animation isn't fit with R15 avartar type (maybe). I tested your script, it work pretty well.

Solution

Just check again your animation.

Hope i helped you!

Answer this question