|
| 07 Sep 2013 11:40 AM |
Okay, I'm making a fort for my Clan, and I've decided to make a gate but, because I can't script, I need help with something: If you've been to a group's fort, there may have been a gate there. The way that gate usually works is that there are two buttons: red and green. The green button opens the gate, whereas the red closes it. I'm trying to make a gate like that, but I don't know how to. If anyone knows, please help! |
|
|
| Report Abuse |
|
|
| |
|
domb26
|
  |
| Joined: 10 Nov 2012 |
| Total Posts: 24 |
|
|
| 07 Sep 2013 12:13 PM |
some items from the catalog will do it. the links are: http://www.roblox.com/FOB-Main-Gate-item?id=106284198 http://www.roblox.com/Elite-Desert-Attack-Squad-Base-gate-item?id=70315522 http://www.roblox.com/Military-Fence-Gate-item?id=44167284 |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 12:13 PM |
| I know, but I don't want to use free models. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Sep 2013 12:14 PM |
local Open = true local Part = game.Workspace.Model:GetChildren()
Button.ClickDetector.MouseClick:connect(function(p) Open = not Open for id,val in pairs(Part) do val.CanCollide = open val.Transparency = Open and 1 or 0 end end) |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 12:15 PM |
| Ah, thanks. Do I insert that script in the model? (I'm new to scripting) |
|
|
| Report Abuse |
|
|
your90
|
  |
| Joined: 06 Mar 2011 |
| Total Posts: 1380 |
|
|
| 07 Sep 2013 12:17 PM |
Close:
function onClicked() script.Parent.Transparency = 0 --Assuming the script is in the door. script.Parent.CanCollide = true --^ wait(2) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Open:
function onClicked() script.Parent.Transparency = .5 --Assuming the script is in the door. script.Parent.CanCollide = false --^ wait(2) end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 12:19 PM |
Thank you. I will work on this now. I'll post the link to the fort once I'm done ^_^ |
|
|
| Report Abuse |
|
|
your90
|
  |
| Joined: 06 Mar 2011 |
| Total Posts: 1380 |
|
| |
|
|
| 07 Sep 2013 02:52 PM |
| Wait, how do I ensure that those scripts open the correct gate? Do I need to insert another script into that gate? |
|
|
| Report Abuse |
|
|