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

How would I make an elevator to be GUI activated?

Asked by 10 years ago

This is for the rocket project that many of you have helped me out with, for which I thank you. I have the rocket working, for the most part.... Anyways, is there any way possible to create an elevator that instead of using a part button to control going up and down using a TextButton from a GUI? Or is that not a possible thing to do currently?

0
--I have the elevator already made for a button input, and it functions properly. areiydenfan00 115 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

You could use a Bindable Event, and when you click the GUI button, and the event happens, the elevator goes up.

To use a bindable event, insert a bindable event.

To activate it, on the GUI, make it so when you click the button, put the location and name of the Event followed by :Fire()

So, then, on the elevator script, around the code where it goes up, put

YourEventLikeAbove.Event:connect(function() instead of :Fire(), then at the end of your script put

end)

For a better explanation, here is an example.

function onClick()
game.Workspace.ElevatorUp:Fire()
end

then

game.Workspace.ElevatorUp.Event:connect(function()
--Elevator up code here.
end)
0
How do you set up a Bindable Event??? (I have never even touched that part of Studio) areiydenfan00 115 — 10y
0
Figured it out! Thanks! areiydenfan00 115 — 10y
Ad

Answer this question