Hi,
I need help with creating a script that will disable proximity prompts for one client but I know that proximity prompts and their triggering time are handled by server so I wanted to fully cut off any connections between server and client in case of triggering proximity prompt for about 30 seconds (I also want to make it not visible for player).
The only thing I can invent is marking player on server when he can’t use proximity prompt and in other script that handles event add if and do code when player is not marked. I would also create a LocalScript that would disable all proximity prompts in workspace for the client. I believe there’s a better solution.
Proximity prompts can be triggered in both side, server and client.
There is a solution, in server side by using “PlayerAdded” function you can add a “BoolValue” for each players, rename it as player name, and put it wherever you want, so in server side you can change it’s value to true when the player can use a proxi and false when he can’t.
In addition to that, in a local script use a “Changed” function to the Localplayer boolvalue, then disable/enable the proximity prompt depending of it’s value.
So while trigering a prompt in server side, you can check the player BoolValue.value before doing what it is supposed to do.
This solution isn’t exactly what I wanted to achieve but it’s flexible so I’ll use it instead. I also modified it a bit due to other factors in the game.
If you are interested in disabling ALL prompts for a certain period of time and for just one player, you can do a “quick fix” using a local script that identifies prompts in PlayerGui and leaves BillboardGui.Enable = false.
Something like: (Of course, if the guy is persistent and for some reason wants to activate using exploit means, you should find a solution by scripting and verifying it.)
game:GetService("RunService").Heartbeat:Connect(function()
if plr.PlayerGui:FindFirstChild("ProximityPrompts") then
for i, x in pairs(plr.PlayerGui.ProximityPrompts:GetChildren()) do
if x:IsA("BillboardGui") then
x.Enabled = false
end
end
end
end)