Hi, I'm a really really bad scripter and I only know basic and easy stuff. When I try to test my game I jump on the laser consistently, it wouldn't kill. This is my script: `~~~~~~~~~~~~~~~~~ debounce = false script.Parent.Touched:Connect(function(hit) if not debounce then
debounce = true if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(20) end wait(0.5) debounce = false end
end) ~~~~~~~~~~~~~~~~~ ` Does it have to be published for it to kill instantly?
I don't really know how to tab the script because i'm fairly new to this site so please don't blame me. Sorry.
Put wait(0.5) and debounce = false before line 5 The problem is the script isn't running it
This is a better script for a laser, because you don't need to use debounce:
script.Parent.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") --Checks if there is a Humanoid if humanoid then --If there is a humanoid, do following humanoid.Health = 0 --Kill player end end)
Hope this helped!