Hello, I’ve recently been hyperaware of the power that exploiters can have and I have been trying to make my game as safe as possible. I want to send what model the client has clicked to the server, but I believe that using a remote event to pass the parameters would be unsafe as an exploiter could send a different model to the server. If anyone knows how I would do this in a safe manner that would be amazing. Thanks.
Extra info: I need to send what model was clicked so I can tween an object to that model from the server. I also need to know what level that model is because different leveled models give a different amount of coins.
You could use a RemoveEvent and send the object that the player clicked, and check on the server if the Client’s Character is within a certain distance using :DistanceFromCharacter(object.Position).Magnitude <= 10(in studs).
for _, clicky in pairs(game.Workspace:GetDescendants()) do
if clicky:IsA("ClickDetector") and clicky.Name == "ClickDetector" then -- remove clicky.name if needed
clicky.MouseClick:Connect(function()
-- action
end)
end
end
here is the action part i guess:
game.ReplicatedStorage:FireClient()
MAKE SURE TO RUN THIS ON A SERVERSCRIPT plus add a remoteevent in replicatedstorage
this isn’t a bad idea, but because I will be constantly spawning and deleting models I feel it would be performance heavy to run this script every time a new model is created