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

When the hopperbin is deselected, and I click it still plays the animation! Help?

Asked by 7 years ago
Edited 7 years ago

When I select the Hopperbin and I click my character punches and when I deselect the hopperbin it still punches!

UIS = game:GetService("UserInputService")
Player = game.Players.LocalPlayer
FireDebounce = true
AttackDebounce = true

script.Parent.Selected:connect(function()
    UIS.InputBegan:connect(function(board, GPE)
    if board.UserInputType == Enum.UserInputType.MouseButton1 and not GPE and FireDebounce == true then
        FireDebounce = false
        Player.leaderstats.EXP.Value = Player.leaderstats.EXP.Value + 1
        Punche = Player.Character.Humanoid:LoadAnimation(script.Punch)
        Punche:Play()
        wait(.6)
        Punche:Stop()
        PunchL = Player.Character.Humanoid:LoadAnimation(script.PunchL)
        PunchL:Play()
        wait(.5)
        PunchL:Stop()
        local connection = Player.Character["Left Arm"].Touched:connect(TouchHit)
        wait(.5)
        connection:Disconnect()
        local connect = Player.Character["Right Arm"].Touched:connect(TouchHit)
        wait(.5)
        connect:Disconnect()
       FireDebounce = true
    end
end)
end)

script.Parent.Deselected:connect(function()
end)


1
You didn't add any code for the animation to stop... (Lines 30-31) TheeDeathCaster 2368 — 7y
1
MythicalByte, you shouldn't use HopperBins they are deprecated. Instead use a Tool and set the property RequiresHandle to false. soved 69 — 7y

Answer this question