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

How would I reset the combo after a certain amount of time?

Asked by 3 years ago
Edited 3 years ago

** Enabled = true local combo = 1 damage = 37 script.Parent.OnServerEvent:Connect(function(player,action,var) damage = 37 + player.SkillsFolder.Strength.Value if Enabled == false then return end local chr = player.Character if action =="Attack" then Enabled = false if combo == 1 then local anim = script.Slash1 local playanimation = chr.Humanoid:LoadAnimation(anim) playanimation:Play() combo = 2 else local anim = script.Slash2 local playanimation = chr.Humanoid:LoadAnimation(anim) playanimation:Play() combo = 1 end for i,v in pairs(workspace:GetChildren()) do if v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("Humanoid") then if v~= chr then if (v.HumanoidRootPart.Position - chr.HumanoidRootPart.Position).magnitude < 7 then v.Humanoid:TakeDamage(damage) end end end end wait(0.8) Enabled = true end end)**

Answer this question