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

Need help with the swinging script i'm testing on roblox , no errors or anything , how to fix it?

Asked by 6 years ago
wait()
math.randomseed(tick() *100)
local plr = script.Parent.Parent.Parent
local Number = 1
local Anim = plr.Character.Humanoid:LoadAnimation(script["Anim"..Number])
local debounce = true
script.Parent.Activated:connect(function()
    if debounce then
        wait()
    debounce = false
    Anim:Play()
    wait(0.2)
    debounce = true
    Number = Number + 1
    if Number > 3 then
    Number = 1
    wait(0.2)
    end
    end
end)

the problem is with Number = Number + 1 , it doesn't add the 1 , please help

Answer this question