|
| 25 Jun 2016 02:21 PM |
Hello scripters that know how to script better than me, I was curious as to whether or not someone knew a script that would work to open a gate by pressing a button.
Link- https://www.roblox.com/games/440137802/Fort-WIP-10-completed
as you can see, the gate after the bridge needs to be opened but I want the people to press a button in order to do so, I was wondering if anybody could make help me out on how to script it.
Any help would be appreciated, thanks.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 25 Jun 2016 02:24 PM |
It depends if it's constructed good enough.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:27 PM |
Do you want it to open by the sides or do you want it to move up.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:27 PM |
@handssome if you look at the gate I feel it i constructed fine, I can group it all into one model and place it in a game for you can see
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:29 PM |
I meant if the gate was constructed in a way which makes it possible to open.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:29 PM |
@handsome can you look at it if you have time?
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:31 PM |
I'm looking at it right now.
You could just do the easiest method by lifting up the gate. But then you could do a harder version which is to move it by the sides.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:36 PM |
yes, but I don't have knowledge of the lua language when it comes to doing things like this. I just need help in which way is easier to do
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 25 Jun 2016 02:37 PM |
button.ClickDetector.MouseClick:conect(function(player) --cframe door end)
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:44 PM |
connect*
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:54 PM |
@TimeTicks , button.ClickDetector.MouseClick:connect(function(player) --cframe door end)
I don't understand, how would this move the door, I don't see any numbers
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:58 PM |
also, by door you mean I need to group all the parts and name it door?
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 03:01 PM |
I have made a script for you. You can see it if you want. I will soon make a place for it.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Jun 2016 03:11 PM |
Just meet me here: https://www.roblox.com/games/278346816/handsomebob10s-Place-Number-50
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 03:35 PM |
| Separate the door into 2 models, make the primary part an invisible part on the bottom and issue the :SetPrimaryPartCFrame(cframe) command on the models. That should work. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 03:40 PM |
-- Put the script in your button. -- Add a ClickDetector to the button.
local Group = game.Workspace.Model:GetChildren() -- Change this to the directory of your gate.
-- The gate has to be a model.
script.Parent.ClickDetector.MouseClick:connect(function(player) if script.Parent.BrickColor.Name == "Bright green" then script.Parent.BrickColor = BrickColor.new("Medium Stone Gray") for i=1,6 do wait(0.9) for i=1,#Group do Group[i].CFrame = Group[i].CFrame + Vector3.new(0,5,0) end end for i=1,6 do wait(0.9) for i=1,#Group do Group[i].CFrame = Group[i].CFrame - Vector3.new(0,5,0) end end script.Parent.BrickColor = BrickColor.new("Bright green") end end)
The CFrame can be adjusted and stuffz.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 03:41 PM |
SpeedySeat
Yeah that's much more effective.
Is OP still talking about roblox? ( ͡° ͜ʖ ͡°) - https://www.youtube.com/watch?v=wst8g5CwSyo |
|
|
| Report Abuse |
|
|