|
| 25 Nov 2013 12:18 AM |
| How do we make it so a loop only takes a wait the first time, and the next time it ignores it? |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 12:31 AM |
local Waited; for -blah blah- Waited = not Waited and wait(Time) or Waited --Do stuff end |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 25 Nov 2013 01:57 AM |
for i = 1,10 do if i == 1 then wait() end --code end end |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 09:10 AM |
| using while true do does an infinite loop |
|
|
| Report Abuse |
|
|
BadIy
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 662 |
|
|
| 25 Nov 2013 10:47 AM |
| Smiley has the easiest way. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 03:49 PM |
| I'm trying to make a stamina bar wait 2 seconds before it reloads again. But if you run again before 2 seconds pass, it doesn't reload. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 04:01 PM |
v = 0
while v = 0 do --code here wait(#)
while v < 0 do --same code here |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Nov 2013 04:34 PM |
No prob
--[SimplyPure JOIN NOW! http://web.roblox.com/Groups/group.aspx?gid=945199]-- |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 07:03 PM |
I tried to fix this script. Can somebody help?
local hasRun = false coroutine.resume(coroutine.create(function() Humanoid.Running:wait() hasRun = true end)) wait(2) if hasRun == true and Character.Humanoid.WalkSpeed > 16 then Player.Backpack.Values.Stamina.Value = math.max(0, Player.Backpack.Values.Stamina.Value - .3) else Player.Backpack.Values.Stamina.Value = math.min(Player.Backpack.Values.Stamina.Value + .2, Player.Backpack.Values.MaxStamina.Value) end
|
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 07:15 PM |
| LocalPlayer* maybe? I don't know what you are trying to do or the directory of the script |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2013 10:24 PM |
| Player = game.Players.LocalPlayer. The script is in a model in your starterpack. |
|
|
| Report Abuse |
|
|