Ad
Log in to vote
0

create a textbutton to get out of a seat?

Asked by 11 months ago
Edited 11 months 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 7925 Badge of Merit Moderation Voter Administrator Community Moderator
11 months 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 7925 — 11mo
Ad

Answer this question