So I have 8 bricks. 4 union and 4 parts. When you click the tool it should take away SR1 and SR11 first. Then on the second click it should take away SR2 and S22 etc for 4 clicks. However it only works on the first click then after that I can't click again! Help! Here is the code:
debounce = false
Tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")
local animation = script.EatingAnimation
local animation2 = script.HoldingAnimation
local AnimTrack = hum:LoadAnimation(animation)
local AnimTrack2 = hum:LoadAnimation(animation2)
Tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if debounce == false then
AnimTrack:Play()
debounce = true
if Tool.SR1.Transparency == 0 or Tool.SR11.Transparency == 0 then
Tool.SR1.Transparency = 1
Tool.SR11.Transparency = 1
else
Tool.SR2.Transparency = 1
Tool.SR22.Transparency = 1
if Tool.SR2.Transparency == 1 or Tool.SR22.Transparency == 1 then
Tool.SR3.Transparency = 1
Tool.SR33.Transparency = 1
else
Tool.SR4.Transparency = 1
Tool.SR44.Transparency = 1
end
wait(2.1)
debounce = false
end
end
end)
end)
Tool.Equipped:connect(function()
if player:IsInGroup(2608221) then
AnimTrack2:Play()
end
end)
Tool.Unequipped:connect(function()
AnimTrack:Stop()
AnimTrack2:Stop()
end)
