Okay so I am working on a game which will award players when they finish a job.
So on the client side when they click a button in a GUI it will run this script
local Event = game.Workspace:WaitForChild("Event")
script.Parent.ButtonLabel.MouseButton1Click:connect(function()
Event:FireServer("Pay")
end)
Once that event is fired it will connect to a server script located in ServerScriptStorage
local Event = game.Workspace:WaitForChild("Event")
Event.OnServerEvent:connect(function(Player, String)
if String == "Pay" then
Player.Cash.Value = Player.Cash.Value + 50
end
end)
That works perfectly fine, however say some nerd has an exploiter that they can run events sort of like putting an event in a command bar, how would I prevent them from doing that?
If an exploiter could simply run this event
Event:FireServer("Pay")
then they could easily spam it and get millions of dollars. What do you suggest I should do for a security check so that they cannot spam events for cash?