Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to write basic scripts?

Asked by 10 years ago

I just started and I want to know some basic things, just to get an idea of what I'm leaning and what it'll do.

6 answers

Log in to vote
0
Answered by 10 years ago

****You can do a lot of things, but I'll give you a example I give to people (I teach for free)****

Insert a script into Workspace through BasicObjects (or AdvancedObjects). Next, locate a brick. To locate a brick you must know exactly which parents it has. It kinda works in a step-by-step process. First, insert a brick into Workspace. Right click on the brick in explorer (View>Explorer). And the re-name that brick to BOB. Now, you have a brick with the name BOB. Now you locate BOB through the script. You know how you separate cities and states by commas? That's kinda what you use here. Except here you use a period. So if Workspace is the 'State' and BOB is the 'City'. Then the script turns out to be like this:

Workspace.BOB

Also, you can use this to select a group of collected bricks or a 'Model'. So for example, if BOB was in a model named House. Your script would be Workspace.House.BOB. Now, you've located the brick, but what are you going to do with it? You can do pretty much anything you like, move it, duplicate it, destroy it, change it's color. But today, we're going to make it flash transparent. So far, you have Workspace.BOB Now, if you have the Properties tab open (View > Properties) . You'll see a lot of options or 'children' Near the top, you'll see Transparency, the maximum transparency is 1, so you'll have to use decimals here. Play around with it. You'll notice the close the amount is to 1, the more transparent it is. 1 is completely invisible. So put that in on the end.

Workspace.BOB.Transparency

Now, on the end of the script put in how transparent you want the brick to be. Here, well make it completely invisible. You're script should look like this now:

Workspace.BOB.Transparency = 1

Now, you want the script to wait, we'll make it wait for 1 second. To do this you have to type wait(1) The number between the parentheses is how many seconds the script will wait before resuming. Now you're script looks like this:

Workspace.BOB.Transparency = 1
wait(1)

Now, for you to see the script in effect, make another command, this time making BOB completely visible. Your script should look like this now:

Workspace.BOB.Transparency = 1
wait(1)
Workspace.BOB.Transparency = 0

Remember to add that wait on the bottom line to make sure that when the script repeats itself, it doesn't crash.

Workspace.BOB.Transparency = 1
wait(1)
Workspace.BOB.Transparency = 0
wait(1)

Now, what you do is, as the first line, write while true do. And on the bottom line, write end (dont worry the script repeats itself). Your script looks like this:

while true do
Workspace.BOB.Transparency = 1
wait(1)
Workspace.BOB.Transparency = 0
wait(1)
end

Sorry if I under-simplified things. I'm learning new scripting methods too.

Ad
Log in to vote
1
Answered by 10 years ago

Try going here

Log in to vote
0
Answered by 10 years ago

Bro try reading some things off this https://scriptinghelpers.org/glossary

0
Thanks. No idea how to use the website. Minimum4Letters 10 — 10y
Log in to vote
0
Answered by 10 years ago

Some basic scripts are INSERTING a Script into a brick. Make sure to name the brick whatever you want, so the script will know which brick in particular your trying to run on. From there you can check out the glossary and learn a few words to get you started! Sorry if I have no scripts, I'm a starter to. Enjoy!

Log in to vote
-1
Answered by 10 years ago

Heres a tip, some scripts require a (end) function.

Log in to vote
-1
Answered by 10 years ago

Lets make or customized a part, for example do Game because it's a game Game.Workspace because everything in the game is in workspace Game.Workspace.Part:BrickColor=Really red.... lol just trying to help. Don't know much.

Answer this question