Loops

From Legacy Roblox Wiki
Revision as of 01:07, 28 September 2008 by >ThePeaceWiki (Scripting Tutorial)
Jump to navigationJump to search

Ummm

Ya. I'm ThePeace. I made this page because... I dunno. Oh, Scripting Tutorials.

Tutorials:Scripting

Hello. I'm going to teach you some of the basics of scripting. Starting with something called while true do and end, very important properties in scripting with Lua. To start it off, I'll show you a simple "Fog" script and then break it down for you.


while true do --Starts the loop off m = Instance.new ("Message") --Introduces a new message for the server to show m.Parent = game.Workspace --Makes it exist m.Text = "FOG!!!!!!!!" -- Makes the message say FOG!!!!! wait(0.1) --It waits that long end --Finishes the loop

While true do and end are loop starters and enders. Loops are things that happen over and over. Very useful at times. Here's another example of while true do and end. In the form of a killing script.


while true do game.Workspace.Player'sName:BreakJoints() wait(0.01) end

Short; but effective in Script Builders.

Updates:

I might update soon when I have the time.