|
| 06 Oct 2011 12:27 PM |
The ultimate trick to being a scripter is to mastering how to make code that does what you want, when you want it. Since you are a beginner, you will be walked through the steps to making your code do what you want starting from English to Lua code. Do not think of scripting as translating to a language; think of scripting as giving orders on what to do.
Here's our starting command. It's what we want to happen, and it has been written in plain English.
Remove linker123456789's head.
Naturally, ROBLOX will not like that very much because it's in English! You have to figure out how to express what you want to happen in Lua code.
In game, find Workspace, find linker123456789, find his Head, and remove it.
game is the root of all things in your game. We need to "go down" the family tree and find the right brick to remove. To get an object that is a child of another object this, you use a period (.) after the parent object, then the child object's name. Going through the family tree, we get this:
Delete game.Workspace.linker123456789.Head
This is almost a working ROBLOX Lua statement! Now, to actually remove the head, a method must be used. Methods are functions that do specific things in ROBLOX for you by calling them. Methods are functions of objects in ROBLOX Lua. To call a method on an object in Lua, you use a colon (:) after the object. You then state the name of the method, then two parenthesis with nothing in them. Methods and functions take arguments, which are values given to the function to change how it works. The "remove" method takes no arguments, so we place the parenthesis there to show that there's nothing else we have to give to the remove method.
game.Workspace.linker123456789.Head:remove()
The above statement is syntactically correct Lua code. However, your name probably isn't linker123456789, so substitute your name in. If your name was "AwesomeSocks", then you would use the following:
game.Workspace.AwesomeSocks.Head:remove()
To compare this to English, it would be like saying "The sky has trees". It is grammatically correct English, but an untrue statement. If you state the name of things that do not exist, your script won't work and an error will occur.
My advice to you if this does not help is go directly to a LUA wiki that might be more suited for you.
Questions? PM me! im willing to help anyone who needs it, and if i dont know that exact answer to your question ill find someone who can help you :)
***NOTE:: the best way to see if your getting the hang of it is to read it once, then read it again but this time have ROBLOX studio open on your place, with command bar open so you can copy and paste***
NOTE:: to insert text to the command bar in game is CTRL+V at the same time :) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 06 Oct 2011 01:03 PM |
| LUA is the script you use to create ROBLOX games my friend. |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
| |
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 06 Oct 2011 01:08 PM |
| Yes i know....Its to help those people who dont like to branch out and find a wiki, or a tutorial. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 06 Oct 2011 01:13 PM |
| @linker 2 of the threads I seen by you are totally useless, you say you know how to script in Roblox while you don't even know the name of the scripting language. You make a C++ tutorial copied from somewhere else. Instead of trying to look great do us a favor and learn how to script, else learn something that fits you. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 01:27 PM |
| Right, and this makes you cool? for pointing out something that's not true? |
|
|
| Report Abuse |
|
|
juriaan
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 939 |
|
|
| 06 Oct 2011 01:30 PM |
First of all OP.
Roblox runs at Rbx.Lua Dont say it uses LUA. And what is LUA Anyways? Do you talk about Lua? Rbx.Lua is Lua you are right with that. But it is changed for Secutity , Simpleness and more
Juriaan |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 01:34 PM |
| I don't care what people think about me, it's a virtual game. I just hate people like you. |
|
|
| Report Abuse |
|
|
| |
|
juriaan
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 939 |
|
| |
|
micol2242
|
  |
| Joined: 13 Nov 2010 |
| Total Posts: 4732 |
|
|
| 06 Oct 2011 02:16 PM |
Plagiarizer.
--what is this i dont even-- |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2011 02:26 PM |
| i still don't know what this "LUA" (is anyone actually going to correct this? |
|
|
| Report Abuse |
|
|
myrco1001
|
  |
| Joined: 17 Sep 2010 |
| Total Posts: 2574 |
|
|
| 06 Oct 2011 02:42 PM |
@juriaan: Lua is niet RBX.Lua, het is een beetje anders.
-♂ MYRCO♂- Scripter, music obsessed, atheist and dutch. What else? |
|
|
| Report Abuse |
|
|