Alright, now I a going to guide you through a basic script! Today we will create...
Oh the drama!
A BUTTON DOOR!
First I am required by the board of safety to tell you that decapitation, spontaneous combustion and disco fever are common side effects of scripting! Just thought you'd like to know.
First you need to make 2 blocks, shape them to your desires, one will be our button, and one will be our door! Name the bricks EXACTLY as I tell you, unless you can edit the script to change the required name. No, do not include the quotation marks.
Name the door "Door" and the button "Button" (Most guides go by this name, it is just really simple)
To insert a script into a door, go up to the top of your screen (In the row of File and view)find Insert... Click on insert, and scroll down until you highlight Object, a screen should pop up, choose script! If for some odd reason, you have to type in the name of what you need, type Script, and nothing more! (No comma)
If you already haven't done so, click and drag the script into your Button! Double click on the script to open it, and erase the text inside: print("Hello World!")
Now, group the Door and the Button, and name the group "Adoor" (No quotes)
It is now time to start scripting!
Note, this is a longish way, no shortcuts to confuse you!
In your script, type the following:
function OnTouch(Hit)
game.Workspace.Adoor.Door.Transparency= 1
game.Workspace.Adoor.Door.CanCollide= False
Wait(4)
game.Workspace.Adoor.Door.Transparency= 0
game.Workspace.Adoor.Door.CanCollide= True
end
script.Parent.Touched:connect(onTouched)
If the script doesn't work, it may be because I typed this quickly in a terminal, while my plane was loading, just PM me in game, and I will provide a fixed version!
Basic Terminology!
Here are some terms, I created my own definitions for them! I hope they are accurate enough to appease the picky ones.
function OnTouch(Hit) = When someone touches the brick.
wait(n) = "n" being a variable for a number of your choosing, makes a pause in the script.
while true do = While the server is active/Button is active.
Reflectance = How reflective (shiny) a brick is.Transparency = How transparent(see through) a brick is.
Anchored = Can it be moved? Will it fall?
CanCollide = Can you touch the brick, or will you go through it?
script.Parent.Touched:connect(onTouched) = We need to know WHICH brick is the one being touched!
remove() = Removes the object! Be it a head, or a message.
More coming soon, but remember, this is just basic help!
Comments are not permitted on this post, because I created it as a page element so it stays on the top of the blog forever!
function OnTouch(Hit) = When someone touches the brick.
wait(n) = "n" being a variable for a number of your choosing, makes a pause in the script.
while true do = While the server is active/Button is active.
Reflectance = How reflective (shiny) a brick is.Transparency = How transparent(see through) a brick is.
Anchored = Can it be moved? Will it fall?
CanCollide = Can you touch the brick, or will you go through it?
script.Parent.Touched:connect(onTouched) = We need to know WHICH brick is the one being touched!
remove() = Removes the object! Be it a head, or a message.
More coming soon, but remember, this is just basic help!
Comments are not permitted on this post, because I created it as a page element so it stays on the top of the blog forever!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment