Is there any way to protect proximity prompts?

So I was planning on changing to proximity prompts for my game, but I was worried about something.

Can’t exploiters abuse them? And how can they abuse them (I know they can skip the hold time)

I’m mainly worried about the exploiter being able to fire it from anywhere in the map

1 Like

On the server end, just check if the player is a certain distance away from the prompt.

1 Like

like for example? using magnitude?

Yup. Use the ProximityPrompt’s parent’s position and subtract that from their HumanoidRootPart position, and get the magnitude from that. Check if that magnitude is less than the ProximityPrompt’s MaxDistance (plus a small amount), and only run the code if that is true. I’ve done this before and it works perfectly.

1 Like

hmm so it would be like this:

local part = script.Parent
local ProximityPrompt = script.Parent.ProximityPrompt

ProximityPrompt.PromptTriggered:Connect(function(player)
local char = player.Character
local magnitude = (part.Position - char.HumanoidRootPart.Position).magnitude
if magnitude <=10 then
--my code
       end
end)

would this work?

forgot to add ends so ignore that

yes that would work, keep in mind exploiters can just change their root cframe so that they are in the 10 studs radius of the proximity prompt. This is not as secure as if you would have a server tp check to detect this.

what im trying to do is prevent exploiters from firing all of the proximity prompts in 1 second, so would the code that i wrote work?

if you read what i said, no it won’t work.

any other way that i can make it more secure?, i saw your coment that you deleted but Im not familiar with it

what you have now is ok, it will at least stop exploiters from firing the proximity prompt from a long distance. But if you know what you’re doing you could make the checks on the client (checking if they are holding down the keys and how long they are doing it for and then sending something to the server)

Isn’t the distance checked from the server? Or atleast it was in beta testing, is it still like this?

Or is the distance client sided now and not server sided?

the distance check is server sided i am assuming but what i’m trying to say is when exploiters change their root cframe it replicates to the server. Making the magnitude check client sided would only make it 100x easier to bypass the magnitude check

no, i made the magnitude check server sided as you can see by the triggered function

Its not that simple. The exploiter would still be able to fire the events that would be responsible for verifying it. The basic rule for client-server communication is never trust the client. It isn’t really possible to verify anything unless done entirely on the server. The most that solution would do is make it a tiny bit more annoying to exploit and take up your time trying to script it.

1 Like

To add, you could add a Debounce to when the Proximity Prompt is triggered to prevent exploiters from triggering it a ton of times.

my scripts already have that, im worried about the distance though, like them being able to fire it from anywhere in the map

people who say, “never trust the client” are the ones to make the most basic anticheats. If you know what you’re doing like i said, you can make great client checks along with server checks

Its impossible to to make any client checks. Exploiters can simply delete/disable and localscript they want. They have absolute control over most, if not all, of the client’s scripts. It’s better to live never trusting the client than trying to make some strange local anticheat and expect it to work.

2 Likes