|
| 22 Apr 2015 11:59 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then if hit.Parent.Name ~= script.Parent.Name then hit.Parent.Humanoid.Sit = true hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health-0.1 wait(math.random(0.5,1)) end end end)
How would I make this have a small pause before damaging the player again? |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 12:07 AM |
local d = false script.Parent.Touched:connect(function(hit) if d then return end d = true if hit.Parent:FindFirstChild("Humanoid") ~= nil then if hit.Parent.Name ~= script.Parent.Name then hit.Parent.Humanoid.Sit = true hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health-0.1 end end wait(0.5) d=false end) |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 23 Apr 2015 05:48 AM |
For even smaller, use wait()
For even smaller use
game:GetService("RunService").RenderStepped:wait() |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 06:23 AM |
If you want use wait. wait(TIME IN SECONDS) ----------- example: wait(1.5) for 1 second and 5 milliseconds. (Not sure if .5 is milliseconds :P)
~Friendly |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 06:29 AM |
I'd recommend using a desperate variable to find the random number. Then wait('variable name') |
|
|
| Report Abuse |
|
|
Proxemics
|
  |
| Joined: 30 Oct 2013 |
| Total Posts: 2542 |
|
| |
|