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

How would you make a seat control gui?

Asked by 8 years ago

Trying to create a control seat that when you sit on it a gui appears and gives you a switch to turn on or off anti jump seats (controls other seats so the player can't jump out of them). Would anyone know how to do this? I have extremely basic gui skills (not even basic). Thanks.. An example script would be perfect!

1 answer

Log in to vote
0
Answered by 8 years ago

I'd advise looking at this article to work out how you'd detect when a player sits down.

From here, you'd simply clone your Gui into Player.PlayerGui

In your gui, find your TextButton and insert a LocalScript

Use the MouseButton1Down event on the button to detect when a player clicks the button.

Now to make a player "stick" to the seat, I'm not entirely sure about. There are probably easy ways to do it, but the only thing that comes to mind at the moment would be to use a Weld to attach the player's torso to the seat.

Look at this article to learn about using welds. You'd need to set Part0 to the seat, and Part1 to the Character's torso, then change the C1 value to:

Weld.C1 = CFrame.new(0, 3, 0) --Or somewhere around that

Like I said though, I'm not entirely sure how I would do this and I've not tested anything, so by using this weld, it may automatically jump the player out of the seat.

Hope this helped.

0
Thanks for the detailed response! I'm a fairly new scripter, i don't fully understand everything you mentioned. 0mrlight0 40 — 8y
0
I'd advise reading the articles included in my response. If it is the language that you're struggling with, then check the "Scripting Glossary" (at the top of this page) darkelementallord 686 — 8y
0
If you still don't understand, then it might be an idea to do some easier scripts and build your knowledge before attempting this. darkelementallord 686 — 8y
Ad

Answer this question