I'm trying to make a function that when you seat, a gui will appear, i finished 90% of my game, now i need help with this? Can someone help me?
✓ ANSWER ACCEPTED
GUI when the player seat?
2 answers
✓ Accepted answer
Requests are against guide rules, but i guess ill help, for this we gotta use the Seat.Occupant property and this pretty much the humanoidxof the player that is setting on the seat, so if lets say "plr1" is setting on it, this property will be "plr1", but if no one is setting this property will be nil, so all we gotta do is check if its nil
this gotta be a local script since uis are local
local seat = workspace.Seat
local ui = script.Parent
while true do
wait()
if seat.Occupant == nil then
ui.Visible = false
else
ui.Visible =true
end
end
And thats it, i tested this and it worked
It was not a request, i asked help
4 comments
0
.....
0
you were asking for a script
0
nvm
0
my answer helped?
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Just a short comment, try not to use loops in these kinds of scripts :)
welp, this is an old answer xd but anyways, can you not use loops here? i dont think so because we need to always check if the occupant is nil, idont think theres some sort of event for that