Hey Devs
I am trying to add a second animation to a scythe im making
local Debounce = true
local animation
local player = game.Players.LocalPlayer
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
if Debounce == false then return end
Debounce = false
animation = player.Character.Humanoid:LoadAnimation(script.Parent.Attack)
animation:Play()
wait(0.5)
Debounce = true
elseif player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
if Debounce == false then return end
Debounce = false
animation = player.Character.Humanoid:LoadAnimation(script.Parent.AttackR15)
animation:Play()
wait(0.5)
Debounce = true
end
end)
end)
script.Parent.Unequipped:Connect(function()
if animation then
animation:Stop()
animation = nil
end
end)
This is my script that I have (I’m using both R15 and R6)
Thanks!
Hey 7z99, I tried that and it didn’t work, maybe I put it in the wrong place.
local Debounce = true
local animation
local hasClicked = 0
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
if Debounce == false then return end
Debounce = false
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Attack)
animation:Play()
wait(0.5)
Debounce = true
elseif game.Players.LocalPlayer.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
if Debounce == false then return end
Debounce = false
hasClicked = hasClicked + 1
if hasClicked % 2 == 0 then
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.AttackR15)
else
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.AttackR152)
end
wait(0.5)
Debounce = true
end
end)
end)
script.Parent.Unequipped:Connect(function()
if animation then
animation:Stop()
animation = nil
end
end)
P.S
I was testing for only R 15 so scroll down to the R15 part.