I have a server script with this code:
local candamage = true script.Parent.Activated:Connect(function() script.Parent.Blade.Touched:Connect(function(hit) local Char = hit:FindFirstAncestorOfClass("Model") if Char then local Hum = Char:FindFirstChild("Humanoid") if hum then if candamage == true then candamage = false Hum:TakeDamage(15) wait(0.6) candamage = true end end end end) end)
But it only kills the player on the client like its inside a local script
Try this
local SP = script.Parent local debounce = true local damage = 20 SP.Activated:Connect(function() SP.Touched:Connect(function(hit) local EnemyHumanoid = hit.Parent:WaitForChild("Humanoid", 3) if EnemyHumanoid and debounce then debounce = false EnemyHumanoid:TakeDamage(damage) wait(0.5) debounce = true end end) end)