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: wait()

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Mar 2014 12:04 PM
Can you make things continue during a wait() I want something to happen during the wait so it can stop it
Report Abuse
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
13 Mar 2014 12:06 PM
WHAT? MAKUS SENSUS PLEASES!!!
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Mar 2014 12:08 PM
I want a certain part of a script to continue during a wait() So I can break it.
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
13 Mar 2014 12:11 PM
coroutine.wrap(function()
wait(5)
print("look I print during a wait!")
end)()
print("starting wait")
wait(10)
print("I printed after the wait")
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Mar 2014 12:12 PM
Could you explain that?
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
13 Mar 2014 12:16 PM
Coroutines start a new thread which runs in parallel with the current thread. Well its more complicated than that but that is how it works simply. Look here for more info.

http://wiki.roblox.com/index.php/Beginners_Guide_to_Coroutines
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Mar 2014 12:21 PM
How would I break the wait?
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
13 Mar 2014 12:42 PM
coroutine.wrap(function()
wait(5)
print("look I print during a wait!")
end)()
print("starting wait")
for i=1,10 do
wait(1)
if i>5 then break end
end
print("I printed after the wait")
Report Abuse
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
14 Mar 2014 12:24 PM
Oooooh, yeh, what guy above said, I was unsure what you meant, Sooz brah!
Report Abuse
dedushy is not online. dedushy
Joined: 06 May 2011
Total Posts: 2125
14 Mar 2014 01:14 PM
Wait so what you want again?
Report Abuse
dedushy is not online. dedushy
Joined: 06 May 2011
Total Posts: 2125
14 Mar 2014 01:14 PM
@RobotMeta Yep
Report Abuse
UnStunned is not online. UnStunned
Joined: 14 Jun 2012
Total Posts: 122
14 Mar 2014 01:41 PM
Print("Hi,I am UnStunned.")
wait(1)
else,
m= Instance.new("Message",Workspace)
m.Text="Hello"
wait(5)
m.Text="Welcome to my first game."
wait(5)--Wait helps us in pausing the current action in a certain time limit.
m:remove()

Like:-
function OnTouch(UnStunned)
local h=UnStunned.Parent:findFirstChild(Humanoid)--Humanoids are the stats that a robloxian has.Eg-Speed,Health,MaxHealth,Jump,Sit(Jump and sit are used with true and false)
wait(10)--This is recognize your touch but will kill you after the 10 sec,not immediately
if h~=nil then
h.Health=0
end
end

UnStun=script.Parent.Touched:connect(OnTouch)--This connects you to the function.
--Hope this will help you.
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