|
| 03 Oct 2011 02:55 PM |
Hello! I'm going to be teaching you about scripting, it's really not that hard!
In this lesson i'm going to show you:
1. Creating a script 2. The Output 3. Commands 4. Waits
1. Before we can even start scripting, you must know how to create one. So, open "Roblox Studio", and push "Ctrl + N". This will open a brand new project, it's always good to start fresh ;D Now, to get all are tools ready. For scripting, we are going to need are "Output Bar", "Explorer" and "Properties" tabs open. Find and open them by clicking "View" on the Top Left.
2. Another great thing you need to know before scripting is the "Output". The Output lets you know whats running, and whats not, whats not working, and what is. And if it's not working, then it shows you what line the error is on, and what you might need in order to fix it.
3. Ok, now we can start scripting!! Push "Insert" and select "Object", then find Script and open it. Double click the script, and it should open a white window with the words "print 'Hello world!'". Delete it, we will learn about printing later. WE are going to start out with a command script, command scripts are scripts that only include 1 line or so. They are the easiest type of script. Today, we are going to kill a robloxian, after 5 seconds.
First, since the Player is going to be in the "game", and inside "Workspace", we say "game.Workspace.Player". Now, we want to remove the Players Head, so in order to do that, we must go inside the Player, and find Head, like this. "game.Workspace.Player.Head" And to remove it... "game.Workspace.Player.Head:remove()".
Try testing your script in Script Builder.
It works!
Now, we need to make it wait "5" seconds, so, if we want something to wait, we say "wait()". And we put the number in between them like this, "wait(5)"
Put this BEFORE your previous script, so it should look like this:
"wait(5)
game.Workspace.Player.Head:remove()"
Good! Were done with this tutorial... So be sure to read the next one!
- Jojobenten
Have a question? Post it! |
|
|
| Report Abuse |
|
mew9O3
|
  |
| Joined: 10 Jun 2011 |
| Total Posts: 179 |
|
|
| 03 Oct 2011 02:56 PM |
I always knew you didnt have much scripting talent
ಠωಠ |
|
|
| Report Abuse |
|
|
| 03 Oct 2011 02:58 PM |
@Mew
..? If i didn't, why did my game get on the front page 72 times?? DD:
I hate to be mean, but yours hasn't. |
|
|
| Report Abuse |
|
|
| 03 Oct 2011 02:58 PM |
Whew, that really worked, add more!
+ Add a glossary of technical terms describing what they mean at the end :P |
|
|
| Report Abuse |
|
dap300
|
  |
| Joined: 23 Nov 2009 |
| Total Posts: 4738 |
|
|
| 03 Oct 2011 03:07 PM |
game.Workspace.Player.Head:remove()
n0b
coroutine.resume(coroutine.wrap(game.Workspace.Player["Head"]:Remove()))) |
|
|
| Report Abuse |
|
|
| 03 Oct 2011 03:12 PM |
| You should really stop using camelCase. |
|
|
| Report Abuse |
|
| |
|
| 03 Oct 2011 03:52 PM |
| Most of people refer to it as camelCase to show what it is. But yeah, Roblox seems like removing all camelCase things. |
|
|
| Report Abuse |
|