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 » Scripting Helpers
Home Search
 

Re: Loop

Previous Thread :: Next Thread 
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
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
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
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 is not online. 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
lightpower26 is not online. lightpower26
Joined: 26 Apr 2012
Total Posts: 1046
25 Nov 2013 09:10 AM
using while true do does an infinite loop
Report Abuse
BadIy is not online. BadIy
Joined: 08 Apr 2010
Total Posts: 662
25 Nov 2013 10:47 AM
Smiley has the easiest way.
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
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
SimplyPure is not online. SimplyPure
Joined: 23 Jan 2011
Total Posts: 102
25 Nov 2013 04:01 PM
v = 0

while v = 0 do
--code here
wait(#)

while v < 0 do
--same code here
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
25 Nov 2013 04:12 PM
Thankxs.
Report Abuse
SimplyPure is not online. SimplyPure
Joined: 23 Jan 2011
Total Posts: 102
25 Nov 2013 04:34 PM
No prob

--[SimplyPure JOIN NOW! http://web.roblox.com/Groups/group.aspx?gid=945199]--
Report Abuse
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
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
SimplyPure is not online. SimplyPure
Joined: 23 Jan 2011
Total Posts: 102
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
ninja900500 is not online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
25 Nov 2013 10:24 PM
Player = game.Players.LocalPlayer. The script is in a model in your starterpack.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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