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

(SOLVED)How do I make the drinking and idle animations for this cup work?

Asked by
skyaz1 72
4 years ago
Edited 4 years ago

I made a cup recently, and have a script to animate it. So far, when I activate the cup, the sound for it plays, but nothing else happens. I have an idle animation(which is looped), and a drinking animation. I don't know what is wrong with the script. Note: The Drink and idle animations are stored in the local script(which is the script this code is in)

local canDrink = true

script.Parent.Equipped:Connect(function()
    local DrinkAnim = script.Parent.Parent.Humanoid:LoadAnimation(script.Drinking)
    local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
    idle:Play()
end)

script.Parent.Activated:Connect(function()
        if canDrink = true then 
        canDrink = false
        local DrinkAnim = script.Parent.Parent.Humanoid:LoadAnimation(script.Drinking)      
        local sound = script.Parent.Handle.Drink
        local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
        idle:Stop()
        DrinkAnim:Play()
        sound:Play()
        wait(1.5)
        idle:Play()
        canDrink = true
        end
end)
0
lets see the full script and is there errors in the output. you need to provide all of this when you go on this website. 123nabilben123 499 — 4y
0
this the full script. there are no output errors skyaz1 72 — 4y
0
Are you sure the drinking animation and idle animations have the right animation priority? virushunter9 943 — 4y
0
which priority should I set the anims to?(I'm very new to animations) skyaz1 72 — 4y
0
I did some research and changed the prioritys accordingly, now it works! Thanks for the help:D skyaz1 72 — 4y

Answer this question