Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

GUI when the player seat?

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?

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

2 comments

0

Just a short comment, try not to use loops in these kinds of scripts :)

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.