Pretty self explanatory. I was wondering if there’s any way to call Remote Events safely without vulnerabilities, such as exploiters manipulating the remote event being called, what are some methods?
There really isn’t a safe way to call a RemoteEvent
, but you can make it more secure by validating and checking on the server-side.
That might usually work in some scenarios, but what should I do typically when I’m unable to check server-wide and I have to use a remote?
Well, their really isn’t anything you can do. Would you be able to provide a specific scenario because almost always you would be able to validate and check on the server-side.
Placing down a part using UserInputService (so it translates from the client to the server). Here’s a sample below from the client script.
(I haven’t tested the code below, I am not sure if it works or not.)
local replicatedStorage = game:GetService("ReplicatedStorage")
local userInputService = game:GetService("UserInputService")
local plrs = game:GetService("Players")
local remote = replicatedStorage:FindFirstChild("Remote")
local plr = plrs.LocalPlayer
local mouse = plr:GetMouse()
userInputService.InputBegan:Connect(function(input, gpe)
if gpe then
return
end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
remote:FireServer(mouse.Hit.Position)
end
end)
Well, server-sided checks wouldn’t be necessary as for this you would absolutely need the information from the client as to get the mouse position. But for example if you had a cooldown, place limit, or certain distance then you would be able to do server-sided checks.
eh, just fire two or more at once?
check if all are fired, if all are, run the script through, if both aren’t running, the script won’t run.
“But what if exploiters run all at once?”
Well idk, doubt that even happen