Help on disabling Proximity Prompts for other clients

Hello, guys! I am currently in the making of a multiplayer Mancala tabletop experience on Roblox. As of right now, I am working on the seating system, and I just want to make a chair that people can sit on to start games. I want to focus on the actual functionality of the chair, because when someone sits on a chair, they’re able to interact with a chair near them by triggering Proximity Prompts, breaking the system. That is why I want to temporarily disable all the other Proximity Prompts in game until the player exits from the seat.

Things I have tried mainly consisted of tinkering with Remote Events. My main idea to overcome this is by disabling the Prompt in the server script and enabling it again in a local script (for the player to get up from the seat), then enabling it for everyone in the server script whenever the player leaves the seat.

Server script (located inside each chair, disables sit Prompt as long as seat.Occupant = true)

local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local prompt = script.Parent.rootPart.ProximityPrompt
local seat = script.Parent.chairSeat
local rootPart = script.Parent.rootPart
local inSeatEvent = ReplicatedStorage:WaitForChild("isSeatTaken")
local promptName = prompt:GetFullName()
local seatEventTwo = ReplicatedStorage:WaitForChild("seat2")

--[[ CFrame code ]]--

local function promptHandler()
	return prompt
end

prompt.Triggered:Connect(function(player)
	if not seat.Occupant then -- Not seated
		isSeatTaken = true
		prompt.Enabled = false
		inSeatEvent:FireClient(player,prompt)
		player.Character.Humanoid.JumpHeight = 0
		seat:Sit(player.Character.Humanoid)
		chairInAnim:Play()
		wait(2)
		prompt.ActionText = "Get up"
	else -- Seated
		isSeatTaken = false
		prompt.Enabled = false
		inSeatEvent:FireClient(player,prompt)
		player.Character.Humanoid.JumpHeight = 7.2
		player.Character.Humanoid.Jump = true
		chairOutAnim:Play()
		wait(2)
		prompt.ActionText = "Sit"
	end
end)

seatEventTwo.OnServerInvoke = promptHandler()

Local Script (located in StarterPlayerScripts, responsible for enabling Prompt only to local player)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("isSeatTaken")
local seatEventTwo = ReplicatedStorage:WaitForChild("seat2")

event.OnClientEvent:Connect(function(player,prompt)
	seatEventTwo:InvokeServer(prompt)
	for _, part in ipairs(workspace:GetDescendants()) do
		if part:IsA("ProximityPrompt") then
			part.Enabled = false
		end
	end
	wait(2)
	prompt.Enabled = true
end)

There is also a Remote Event (“isSeatTaken”) and Remote Function (“seat2”) in ReplicatedStorage

If anyone is able to give me some advice on how to tackle this problem, it would be appreciated! Apologies for messiness of code.

Its best to move Proximity Prompts to ReplicatedStorage or delete them.

I mean, I could try to delete the Prompts and start over, but I’m not sure how the Proximity Prompts would be connected to the chair’s root part if I have it in Replicated Storage. I’ll see if I can try and remake the system using something different.

Change the parent of the Proximity Prompts.

I don’t understand how they would be connected to the chair though. I have a root part for the chair because the chair is a union, and I can easily put a Prompt in there. If I were to put the Proximity Prompts in Replicated Storage, I’m unsure how the Prompts would be responsive, also because if I were to put it somewhere else than the Workspace, it wouldn’t be shown.

robloxProof

You can use Billboard Gui as a alt.

I’m not sure on the exact best way to do this, but I would try it like this:
Client:
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local event = ReplicatedStorage:WaitForChild(“isSeatTaken”)
local seatEventTwo = ReplicatedStorage:WaitForChild(“seat2”)

event.OnClientEvent:Connect(function(player,prompt)
seatEventTwo:InvokeServer(prompt)
for _, part in ipairs(workspace:GetDescendants()) do
if part:IsA(“ProximityPrompt”) then
part.Enabled = false
end
end
wait(2)
prompt.Enabled = true
end)

Server:
local event = ReplicatedStorage:WaitForChild(“isSeatTaken”)
local function promptHandler()
return prompt
end
prompt.Triggered:Connect(function(player)
if not seat.Occupant then – Not seated
isSeatTaken = true
prompt.Enabled = false
event:FireClient(player,prompt)
player.Character.Humanoid.JumpHeight = 0
seat:Sit(player.Character.Humanoid)
chairInAnim:Play()
wait(2)
prompt.ActionText = “Get up”
else – Seated
isSeatTaken = false
prompt.Enabled = false
event:FireClient(player,prompt)
player.Character.Humanoid.JumpHeight = 7.2
player.Character.Humanoid.Jump = true
chairOutAnim:Play()
wait(2)
prompt.ActionText = “Sit”
end
end)

This would just require a RemoteEvent, and a RemoteFunction, which you already have.