How do I make a GUI appear on the players screen who is seated in a specific chair and when a ProximityPrompt Gets Triggered by another player

I want the GUI to pop up when the other player Triggers the ProximityPrompt


It says pasaport not found

You might want to change the title of your post, because you have it asking “appear on the players screen who is seated in a specific chair”

So it makes the reader think you are wanting to have it happen when they sit in a seat part.

In my game, I read the proximity prompts from a local script, is your prompt going to be fired from a client or server script?

Can I just add you in edit to help me out im not that good in scripting if yes add me on roblox

Let me try to get your original script you posted to work first, because it may help others who find this post with the same problem.

If it still does not work, then yeah, I can help you in editor.

Give me a few minutes

1 Like

Fist let me try to get a full understanding of what it is, you are expecting to happen.

You have 2 players, player A has a passport in backpack.
When player B presses the proximity prompt, what happens?
Do you want it to force player A to sit in the seat with the gui?
Or does the proximity prompt unlock the seat, so then player A can sit in it at their leisure?

What should happen if only player A triggers the prompt?
What should happen if a player sits in the seat, before anyone triggered the prompt?

If you could explain how you want to happen.

So basically
Its a pasaport system kind of like ‘‘Papers Please’’

Player A has a passport
Player B is the passport controller

I want to make that when Player A Triggers the proximity prompt
Player B gets a screen gui on their screen.

So where does the ‘seat’ or ‘chair’ come into it?
Will this only happen when player B is sitting in a chair, or is it player A who needs to be in the chair?

Try this, create a new server script and put this in there.

local Players = game:GetService("Players")

local Seat: Seat = workspace.SMSEAT
local ProximityPrompt: ProximityPrompt = workspace.PassPart.ProximityPrompt

local Connection: RBXScriptConnection?

ProximityPrompt.Triggered:Connect(function(Player)
	local Humanoid: Humanoid = Player.Character.Humanoid

	if Seat.Occupant and Seat.Occupant ~= Humanoid then
		local UI: UIBase = Players:GetPlayerFromCharacter(Seat.Occupant.Parent).PlayerGui["Pasaport Gui"].Passaport

		if not UI.Visible then
			UI.Visible = true

			if Connection and Connection.Connected then
				Connection:Disconnect()
			end

			Connection = Seat:GetPropertyChangedSignal("Occupant"):Once(function()
				if UI.Visible then
					UI.Visible = false
				end
			end)
		end
	end
end)
1 Like

Player B must be sitting in the chair for it to work

ok, let me type something up and see if I can get it working.

Okay thanks let me try it right now

This infact worked but the GUI popped up on the wrong player

When I Triggered the Proximity prompt it popped up on the charachter that triggered the Proximity prompt but I want it to pop up in the seated players screen

I updated the script, please try again

It is still the same as before

Did you come up with any script yet?

You tried? I tested my script and everything works as you wanted, try refreshing the page for my changes to take effect.

I refreshed the page and im trying again I hope it works :slight_smile:

Thank you so much it finally worked im so happy again thank you!!!