generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Small Pause?

Previous Thread :: Next Thread 
CardsOfFate is not online. CardsOfFate
Joined: 08 Jul 2014
Total Posts: 761
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
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
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 is not online. 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
dylanrox44 is not online. dylanrox44
Joined: 15 Apr 2013
Total Posts: 188
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
superbobman is not online. superbobman
Joined: 29 Nov 2008
Total Posts: 939
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 is not online. Proxemics
Joined: 30 Oct 2013
Total Posts: 2542
23 Apr 2015 06:48 AM
@dylanrox

2pro4me
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image