Advertisement - Why am I seeing ads? Report
   
 

[ Content Deleted ]

Sort:
Previous Thread :: Next Thread 
sirloin is not online. sirloin
Top 100 Poster
Joined: 21 Jan 2007
Total Posts: 3183
21 Aug 2007 02:24 PM
[ Content Deleted ]
Report Abuse
jerkkiller is not online. jerkkiller
Top 100 Poster
Joined: 31 May 2007
Total Posts: 3145
21 Aug 2007 02:24 PM
wiki
Report Abuse
danielmcb is not online. danielmcb
Top 100 Poster
Joined: 29 Mar 2007
Total Posts: 2176
21 Aug 2007 02:24 PM
at this forum :)
Report Abuse
TehGeek is not online. TehGeek
Joined: 02 Aug 2007
Total Posts: 70
21 Aug 2007 03:00 PM
[ Content Deleted ]
Report Abuse
sirloin is not online. sirloin
Top 100 Poster
Joined: 21 Jan 2007
Total Posts: 3183
21 Aug 2007 03:01 PM
[ Content Deleted ]
Report Abuse
Glitchmaster2 is not online. Glitchmaster2
Joined: 30 Jun 2007
Total Posts: 649
21 Aug 2007 04:21 PM
Scripting makes my head hurt....
Report Abuse
builderkirby is not online. builderkirby
Joined: 13 Aug 2007
Total Posts: 104
21 Aug 2007 04:25 PM
lol
Report Abuse
SonOfSevenless is not online. SonOfSevenless
Top 100 Poster
Joined: 18 Feb 2007
Total Posts: 245
21 Aug 2007 04:41 PM
Most people who try to learn to script start out trying to do big things and get discouraged.

The best way to learn is by looking at how other people's scripts work and changing them slightly. Then making bigger changes as you figure things out.

Very few people on Roblox can write a brand new script from scratch to do whatever they want.
Report Abuse
sirloin is not online. sirloin
Top 100 Poster
Joined: 21 Jan 2007
Total Posts: 3183
21 Aug 2007 04:45 PM
[ Content Deleted ]
Report Abuse
koolnate5 is not online. koolnate5
Joined: 13 Jul 2007
Total Posts: 125
21 Aug 2007 04:49 PM
sirloin! you, the greatest builder on robloix(well you and miked) cant script??? lol, thet makes me feel better about myself!
Report Abuse
sirloin is not online. sirloin
Top 100 Poster
Joined: 21 Jan 2007
Total Posts: 3183
21 Aug 2007 04:50 PM
[ Content Deleted ]
Report Abuse
lavamaster is not online. lavamaster
Joined: 27 May 2007
Total Posts: 4633
21 Aug 2007 04:52 PM
awkward wat sonsofthesevenless does is wat i do to learn script lol thought i was the only person who does this guess im rong =/
Report Abuse
BLOOXERindisguise is not online. BLOOXERindisguise
Joined: 16 Sep 2007
Total Posts: 6939
21 Oct 2007 12:55 PM
[ Content Deleted ]
Report Abuse
cruckshank is not online. cruckshank
Top 100 Poster
Joined: 10 Jul 2007
Total Posts: 1936
21 Oct 2007 02:04 PM
sirloin im sure ur a greate scripter m8 u just dont know it try editing scripts tht look easy like regen swcripts/ghost scripts i envented 1 it makes things flash like i envented a flashing shirt admi door (id be happy to teach u)


?-cruckshank-?
Report Abuse
CoffeeLord is not online. CoffeeLord
Joined: 07 Sep 2007
Total Posts: 665
21 Oct 2007 02:54 PM
There was a very good post that stealth pilot put that will really help:



Hey,

Many users still don't know how to write one line of script. Even though the wiki has info, I'll show some basic lessons for scripting. There are 5 topics that will be answered:

Creating the script

Tagging objects

The listening event

The function

Modifying objects/tags

NOTE: I strongly recommend doing all work, building and scripting, in Edit Mode. All these lessons will be shown as if you are in Edit Mode. To open Edit Mode, on your desktop screen, hit Start>Programs>ROBLOX>ROBLOX Studio. Then go to your profile, then click "Edit".
___________________________________________________________________________

Lesson 1: Creating the script

What work to be done when you don't have the project? To get a script, simply select Insert>Object. Now a window will show up. In the textbox, type "Script". Do not mispell, and make sure that the first letter is in capital. You should find the script inside"Workspace" in the explorer tab. If you don't see any explorer window up, go to View>Explorer.

Now to open the script, just double-click it. If you did it right, a window will cover the whole ingame screen, and the browser should look a bit more like Microsoft Word. And you will find the line "print("Hello World!")"(Don't ask me why, long story). Before you start, just go ahead and delete that line.

___________________________________________________________________________

Lesson 2: Tagging objects

You got a nice script up, but what good is a script if it doesn't have anything to play with? Assuming the script is still under Workspace, that is where your script will run under. Let's say you want a brick turning invisible/visible, back and forth when touched. That's a good starter on showing your powers of scripting. The script needs to know where that brick is before modifying it.

Now, tagging objects are not necessary, but it can make scripting alot less work. Now here's an example of tagging objects:

brick = game.Workspace.Brick

That will tag the brick under the name you assigned. You can set the name to anything, even "noob", lol. And you can have as many tags as you want, not limited to one, you know.

Now, if you didn't tag it, everytime you try making the script modify the object (explained in lesson 5), you would have to put the line "game.Workspace.Brick" EVERY single time. Not fun. Tags are the way to go, since you'd only have to put the name you assigned. Less time, more fun. Make sure you name the brick desired to something other than "Part" or "Smooth Block Model". Scripts have a hard time picking bricks you want if every brick in the same category has the same name.

So let's start basic. Name the brick desired to "Brick", and tag it in the script by typing the example above.

___________________________________________________________________________

Lesson 3: The listening event

Now we're getting into the meat of scripting. Sure, the script knows where the brick is, but that's all. I can't do anything else. Now we're jumping into a listening event.

What is a listening event? It's the trigger of the script. This is gonna tell the script to do something if the listener finds the trigger fired. This is one important part of the script, otherwise you couldn't really make scripts wait for anything.

Now, you still should have the script with the tag in it, right? Now, for a starter, we're gonna make the script listen for being touched. Here's an example:

brick.Touched:connect(onTouch)

Let's put it this way: If the brick is Touched, It will connect the (function). The function is explained next lesson. Keep in mind that the name inside the parentheses are the name of the function. You can name this anything, however, I recommend doing the above for this lesson before you jump into any other names.

This is not the only listener type. there are many more to use, some of which require some familiarity with scripting. Here's a very well-done reference page set up by MrDoomBringer:

http://wiki.roblox.com/index.php?title=Class_reference

This is where you can find more help in the future, when you begin to understand scripting more. Not only does it show Events, but also shows other scripting references need for other aspects of scripting (some of which is explained in lesson 5.

So for this lesson, put the line "brick.Touched:connect(onTouch)" a line or two below the tag from last lesson.
___________________________________________________________________________

Lesson 4: The function

Your script is getting better and better, but where is the function at? You're script will break if it doesn't have one of those for the listener to refer the script to.

What is a function? It is where all your modifying work will be done. It is also an important part to your scripting. Without it, you could not make the script modify objects from listeners. Another example:

function onTouch(part)

end

There's the almighty function. as you can see, the function has "onTouch". Yep, the listener from last lesson is trying to refer to the function. Basically, the listener's gonna tell the script to run through this function and do whatever is found inside (explained next lesson). notice after "onTouch". This is the tag of the object that the listener found that touched the brick. This is not always needed, especially for different listeners. Most times, with other listening types unlike touching listeners, you would just place this:

function onTouch()

end

But back to what we're looking at. The tag is the object that touched the brick. You can play with this object for fun later. Now notice also two liens below the function: "end". You will need one of these for every funcion and other aspect of scripting, such as "if" statements. Always remember this when scripting.

Now, make the lines from first example, except put it two lines under the tag, and one line above the listener.
___________________________________________________________________________

Lesson 5: Modifying objects/tags

We're almost there. The script knows the brick, will wait until it's touched, and has the function to use. But it doesn't know what to do to the brick.

Time to have fun. Now this is where tagging objects saves you time. We wanted it to flicker invisible/visible, right? Now to pull that feat off! Here's an example:

brick.Transparency = 1
wait(1)
brick.Transparency = 0

These lines will alter the brick as we wanted. The brick's transparency is changed to "1", which is completely invisible. The "wait(1)" line will make the script wait for one second before continuing, then the brick's transparency will be put back at 0, which is completely visible. You can alter "wait(1)" to any number inside the parenthesis. Whatever number you put inside the parenthesis will be the amount of time it will wait in seconds.

Now, put those 3 lines right under the line "function onTouch(part)" and above the line "end".
___________________________________________________________________________

Now if you did everything as explained in this tutorial, you're gonna have your very first working home-made script! There are many more aspects of scripting to play with, but you must become more familiar with scripting. Here's how:

http://wiki.roblox.com/index.php?title=Class_reference

Enjoy, and I hope this thread that took 1 hour to make helped you! =D

>Pilot<
Report Abuse
CoffeeLord is not online. CoffeeLord
Joined: 07 Sep 2007
Total Posts: 665
21 Oct 2007 02:59 PM
It helped me alot!
Report Abuse
sirloin is not online. sirloin
Top 100 Poster
Joined: 21 Jan 2007
Total Posts: 3183
21 Oct 2007 04:19 PM
[ Content Deleted ]
Report Abuse
keaka is not online. keaka
Joined: 12 Jul 2007
Total Posts: 6
01 Dec 2007 04:39 AM
It helped me too!
Report Abuse
Hangover is not online. Hangover
Joined: 29 Nov 2007
Total Posts: 8
01 Dec 2007 10:27 AM
i'm a bad scripter too, and i'm very confused after reading all those tutorials.. scripts that i'm able to make: making a door that you can go through when pressing a button, making a dance floor, making a message pop up when you press a button.. and i'm probaly not going to get any better, can't even make a healing potion :P guess i'll just have to follow your tips >:D
-sry if my english is bad ^^
Report Abuse
RandomScriptTester is not online. RandomScriptTester
Joined: 08 Nov 2007
Total Posts: 75
01 Dec 2007 12:58 PM
I learned how to script by looking at other scripts :)
Report Abuse
nightstrike is not online. nightstrike
Joined: 25 Nov 2007
Total Posts: 9
01 Dec 2007 05:01 PM
that script tutorial helped so much thanx!!!
Report Abuse
jawa280 is not online. jawa280
Joined: 26 Jun 2007
Total Posts: 453
16 Dec 2007 05:09 PM
Hi ummm... I need some1 to make a model. I need it to be a conveyor with a button, then when the button is touched, the conveyor moves.
Report Abuse
sirloin is not online. sirloin
Top 100 Poster
Joined: 21 Jan 2007
Total Posts: 3183
10 Mar 2008 11:59 AM
[ Content Deleted ]
Report Abuse
yeahbzl is not online. yeahbzl
Joined: 17 Jan 2008
Total Posts: 87
10 Mar 2008 12:45 PM
click on help at the top toolbar to the far right
Report Abuse
shawn87 is not online. shawn87
Joined: 28 Dec 2007
Total Posts: 42
10 Mar 2008 12:53 PM
how do u make a script.Can u help me.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 3Goto to page: [1], 2, 3 Next
 
 
   
 
Advertisement Report