blaze0018
|
  |
| Joined: 13 Sep 2013 |
| Total Posts: 24 |
|
|
| 30 Mar 2014 02:46 PM |
| If one of you guys could comment how scripting working works I would really be happy because I really don't understand how it works |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Mar 2014 02:47 PM |
| You give instructions to the computer and they execute it |
|
|
| Report Abuse |
|
|
blaze0018
|
  |
| Joined: 13 Sep 2013 |
| Total Posts: 24 |
|
|
| 30 Mar 2014 02:48 PM |
| so I just type what I want it to do and it just odes it?? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
planetmax
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 301 |
|
|
| 30 Mar 2014 03:07 PM |
| Scripting is a way of telling the computer what to do. However, computers can only understand commands to do things if you tell them exactly what to do, in a specific code or language. In this case, the language is called Lua, which is relatively simple to understand. |
|
|
| Report Abuse |
|
|
blaze0018
|
  |
| Joined: 13 Sep 2013 |
| Total Posts: 24 |
|
|
| 30 Mar 2014 05:50 PM |
| Can you tell me how to understand lua then? |
|
|
| Report Abuse |
|
|
VFrame
|
  |
| Joined: 22 Mar 2014 |
| Total Posts: 14 |
|
|
| 30 Mar 2014 05:51 PM |
| Check out tutorials on YouTube or check out the basics at the Wiki. |
|
|
| Report Abuse |
|
|
|
| 30 Mar 2014 05:52 PM |
| you have to connect the propertie to the child and the child to the parent |
|
|
| Report Abuse |
|
|
planetmax
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 301 |
|
|
| 01 Apr 2014 05:56 AM |
| You should check out the Wiki, that's where I started. |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2014 10:17 AM |
@OP
Scripting is a way of getting the computer to execute commands, it used to be wrote in binary. Roblox uses a special version of a language called Lua, specifically for roblox, Rblx.Lua I believe. There are many other languages, for many different programs, these include but are not limited to, Batch, Visual Basic, JavaScript, C, C++, C#, and more! Some programs use a language specifically for the program itself, like unity has UnityScript. Lua is a basic, simple language, which is coded in the core in C++. Lua is simple, I consider almost as easy, if not easier, then English (English is the hardest language to learn, after all.) Lua can be easily learned by anyone with an average IQ. (That eliminates most of my class.) If your good at math, it is a good chance you will be good at programming.
Scripting on roblox is time consuming. But the better you become, the faster you are. Eventually the only limit will be your typing speed. But the finished product will make it all worth it. Almost all scripting in roblox does, is make basic objects, like parts, and edit the properties. You could build a whole game on roblox, with just 1 script, and that is all, it would create everything. But don't do that, as it would take a LONG time. You can connect things to happen when an event fires, for example, when a brick is touched;
game.Workspace.Brick.Touched:connect(function(h) print("Touch!") end)
A couple things happened there. First off, let's talk about heriachy. To access a brick, you got to use a thing I like to call, the tree.
The tree is like in explorer;
Workspace -Model --Part ---Script ----LocalScript
To access the child of a part in a script, seperate it with a '.' Lets access that LocalScript shall we?
game.Workspace.Model.Part.Script.LocalScript
If you wanna get a part with spaces you gotta do one of these;
game.Workspace:FindFirstChild("Got Spaces").Part
game.Workspace["Got Spaces"].Part
At the beginning of it I added game, because it has to go I front of anything but Workspace, I added it for documentation.
Another thing that happen was Touched, which fires when it is touched.
Which led to :connect to connect it with a function.
Which brings me to function()
A function is a repeated block of code, which executes thing with arguments, for example h in the example, it was the part that hit it.
print() printed what was in ("") into the output (View -> Output)
Hope I helped! |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2014 01:27 PM |
"it used to be wrote in binary" No, binary is how computers only can interpret thins (1 being a current on, 0 being off)
It is not a language at all, it's just a number system (much like decimal, except base 2, not base 10) and since power can really only have 2 states (on or off), you can't expect a computer to understand another state. |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2014 01:33 PM |
| I started learning scripting on LuaLearners. But when it was closed down, I just learned from ROBLOX Wiki. Actually, I learned more on LuaLearners. I'm still kind of a beginner scripter BTW. |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2014 01:34 PM |
erm, a function is not always a repeated block of code. a better definition, is a function is a value that represents a block of code |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2014 01:34 PM |
| Too bad lualearners gave false information |
|
|
| Report Abuse |
|
|
Kingmouli
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 1292 |
|
|
| 01 Apr 2014 01:37 PM |
@cnt
What kind of false information? Lots of people say this but I don't find something false |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Apr 2014 01:40 PM |
You probably haven't seen false information because they make you assume it is true. Here is one of the obvious ones that I know of (I'm paraphrasing here): type(Vector3.new()) == "Vector3" --When it's actually userdata
|
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
| |
|
|
| 01 Apr 2014 02:22 PM |
the best way to sum up how to script is this:
Find other people's scripts, then learn how they work and WHY they work. If there's something you don't know about it, search it up specifically in the wiki Create your own basic scripts, then remake them over and over and over again Eventually, the simple property changes become second nature, and functions become a thing of habit.
|
|
|
| Report Abuse |
|
|