#Animation won't stop

1 messages · Page 1 of 1 (latest)

pearl cape
#

It's confusing me how the animation won't stop when it's dropped.

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local equipSound = handle:WaitForChild("EquipSound")

local function getHumanoid()
    local char = player.Character or player.CharacterAdded:Wait()
    return char:WaitForChild("Humanoid")
end

local humanoid = getHumanoid()
local idleAnim = humanoid:LoadAnimation(script:WaitForChild("Hold"))
local equipAnim = humanoid:LoadAnimation(script:WaitForChild("Equip"))

-- Equip
tool.Equipped:Connect(function()
    equipSound:Play()
    equipAnim:Play()
    idleAnim.Looped = true
    idleAnim:Play()
end)

-- Unequip/Drop
tool:GetPropertyChangedSignal("Parent"):Connect(function()
    -- Stop idle anim if tool is not in the character anymore
    if not tool:IsDescendantOf(player.Character) then
        idleAnim:Stop()
    end
end)

If anyone can help me, please tell me.

uncut bough
#

@pearl cape have you tried using

tool.Unequipped:Connect(function()?

#

cause i dont think GetPropertyChangedSignal is kindof.. well.. a good idea

pearl cape
#

yea i did that and it worked but only when i unequip it, not when i drop it with backspace

nova hollowBOT
#

studio** You are now Level 5! **studio

pearl cape
#

so idk i just thought more brain power = better function

#

💔

#

i just told the bot to do that cuz i can't be assed to script to make it stop when i drop it cuz idk how to do allat

#

so yes in a sense i'm using AI

#

mmmm maybe i should just disable can be dropped

#

cuz i made the basic script and i was like "what if i were to make it be dropped" then the animation stayed and i couldn't figure it out so i got AI to do this for me

uncut bough
#

just make dropping be disabled and make a dropping script

#

boom ez

#

thats the only way i know how to fix it while being overly dumb rn

pearl cape
#

Holy guacamole it works ❤️ 🥑 🥑