so i have a complicated system in the client where whenever a certain landmark is hit the multiplier adds by 0.1, but the problem here is every 20 seconds i need to send that multiplier to the server via a RemoteFunction and im worried about exploiters because im pretty sure they can change the multiplier and then a wrong multiplier value will get sent to the server,
how can i send it to the server without worrying about the fact players can alter the value,
heres the script:
--server script
local Multiplier = game.ReplicatedStorage.EventsFolder.RequestMultiplier:InvokeClient(plr)
print(Multiplier)
-- client script
local Multiplier = 1 -- this value changed afterward but the default value is 1
game.ReplicatedStorage.EventsFolder.RequestMultiplier.OnClientInvoke = function()
return Multiplier
end
also, i tried making the multiplier in a script so its not a NumberValue, but the problem is that i heard some people on the dev forum say that exploiters can also edit scripts, so if they could then they can just simply change the multiplier value in the script, which is also a problem
its just an energy multiplier, for example the energy is 100, and every 20 seconds you add 1 or 2 to the energy, and the multiplier just makes it AddedValue*Multiplier
You should be able to do that on the server just fine, you could make something to do it in a PlayerAdded subprogram:
local players = game:GetService("Players")
--inside the subprogram
while task.wait(20) do
if not players:FindFirstChild(player.Name) then break end
player.Energy.Value += (1 * player.Multiplier.Value) --these are instance values
good suggestion, but the problem is that the multiplier is in the client so any changes in the client the server cant see, my entire issue is that i dont know how to securly send the multiplier from the client to the server
(btw i need to go for 2-5 minutes and i will come back)
i will try that, and i will probably just scrap the entire multiplier system because i want the energy to have a full value like for example 100, 110, 125, and not 100.5 or 125.9,
and with my current system i cant because it adds 1-2 every 20 seconds and 2x1.2 (for example) = 2.4, and not a full number and if i use math.ceil, then all the values of 1.1, 1.2, 1.3, 1.4 etc, will equal the same so the multiplier will be useless,
thanks for the suggestion, but as i said if i round up 1.4 it will be 2, and if i round up 1.2 it will also be 2, so there wont be a difference in multiplying the number with the multiplier if the multiplier is 1.2x ,1.5x ,1.6x, etc,