Everything is working fine when I don't do the if statement. I cant figure out why it down't work as soon as I put in an if Statement. Can anyone help?
math.randomseed(tick())
local rs = game:GetService("ReplicatedStorage")
local remote = rs.AnimAtEase
local animations = {03174847886}
local active = false
local function onPunchFired(plr)
if active == false then
local char = game.Workspace:FindFirstChild(plr.Name)
local humanoid = char.Humanoid
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://"..animations[math.random(1, #animations)]
local animTrack = humanoid:LoadAnimation(animation)
animTrack:Play()
else if active == true then
animTrack:Stop()
end
end
remote.OnServerEvent:Connect(onPunchFired)

1 comment
Yoy never change the value of "active", it's always false, why do you have the "else if" on line 33?