|
| 29 Jul 2012 10:58 PM |
| I am learning how to script and I was just wondering how to make a working door in Roblox. Please reply if you know how. :) |
|
|
| Report Abuse |
|
|
omzig
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 578 |
|
|
| 29 Jul 2012 10:59 PM |
What kind of door? A VIP door, team only door, group only door?
Or just a normal swinging door? Because those can be made with hinges. However, you could get very complex and spend some time using CFrame.new |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 11:01 PM |
| Um... just a open and close door with 2 buttons. Thank you for being polite though and responding. :) |
|
|
| Report Abuse |
|
|
omzig
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 578 |
|
|
| 29 Jul 2012 11:02 PM |
| Ok, the best way to UNDERSTAND lua is to go to wiki.roblox.com, or use the LuaLearners. I could write somethign out that does this, but I'm not the best at explaining. |
|
|
| Report Abuse |
|
|
| |
|
omzig
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 578 |
|
|
| 29 Jul 2012 11:04 PM |
| It may be hard to understand, but you just hve to try to understand, little by little. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 11:05 PM |
function onClick() script.Parent.Parent.Transparency = 0.5 script.Parent.Parent.CanCollide = false wait(5) script.Parent.Parent.Transparency = 0 script.Parent.Parent.CanCollide = true end
script.Parent.MouseClick:connect(onClick)
Put a click detector in a door and this script in the click detector |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jul 2012 11:08 PM |
| Need help with scripting I could try and show you some of the basics. Like the loops and some of the types of functions and events and changing the properties of bricks. |
|
|
| Report Abuse |
|
|
omzig
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 578 |
|
|
| 29 Jul 2012 11:09 PM |
He was trying to learn how to. ._.
I guess I will try to explain to you what every piece means, to help you.
function onClick() -- This on click part means whenever it's clicked, the stuff below will happen. script.Parent.Parent.Transparency = 0.5 -- Transparency is basicly how invisible it is. 1 is fully invisible, 0 is visible, and 0.5 is half visible. script.Parent.Parent.CanCollide = false -- This makes it so you can walk through the brick. wait(5) -- The door will only be open for five seconds. script.Parent.Parent.Transparency = 0 -- Makes it so you can see it... script.Parent.Parent.CanCollide = true -- Makes it so you can't walk through it. end -- ENds the script
script.Parent.MouseClick:connect(onClick) -- This makes it so that onClick is defined. onClick means nothing without this. This makes it so that the script knows that onClick means whenever the click detector is clicked.
Ok, I know I'm bad at explaining, but I thought I'd tyr.
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 11:10 PM |
| I know he is learning that is why I offered to "Show him the ropes" |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2012 11:33 PM |
| Would I place 2 blocks (Open/Closed) and place a detector script inside of them? Wouldn't I need a command for the detectors too? |
|
|
| Report Abuse |
|
|
omzig
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 578 |
|
|
| 29 Jul 2012 11:45 PM |
| No. He made it so that you can put a clickDetector into a brick (your gate) and then the script into the click detector. Then when you click your gate it opens. |
|
|
| Report Abuse |
|
|