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

create a textbutton to get out of a seat?

Asked by 6 years ago
Edited 6 years ago

I've disabled jumping in my game and I want to make a script that creates a screen gui when the player sits in a seat that teleports the out of the seat position and in front of the seat if they click it but I don't really know how to use function onTouch or how to make a script in a script in a text button in a screen gui with instance.new

does anyone know how i could do this?

also - if i do this with a local script does that mean only the person in the seat can see the gui?

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
6 years ago

You may use the Changed event on the Seat object in order to detect when someone sits or leaves.

Connect a function to the Changed event that will manipulate the Visible Property of the occupant's (GuiButtonObject )

Use the MouseButton1Down event on the GuiButtonObject to fire the Jump function, and get the player out of the seat.

0
This means you make the button first, then reference and change it when the player sits in the seat Goulstem 8144 — 6y
Ad

Answer this question