Hmmm, do i still need to make Remote Events in my simulator game so the coins will not be hacked?
I’m just a beginner so sorry, or we don’t need Remote Events when making the simulator game?
When i lick, i am still new at this remote events things and i heard that this can help to prevent your game being hacked, so i don’t want the Lick Points to get hacked. I want to make the LP keep getting updated when the Tool is activated
If you use a module script, your values can’t be changed so for the most part you don’t really need to use a remote event.
here’s a pretty good video over this.
–for above,he wants to lick using a tool
RemoteEvents are now priorities due to Filtering Enabled being forced to all games.
First, you have to make a local script inside your Lolipop.
Then you have to make it so when you click your mouse while you are using your lolipop, the remote event fires.
Also, Insert a remote event into ReplicatedStorage and name it anything you want
--local script
script.Parent.Activated:Connect(function()
game.ReplicatedStorage.yourremotename:FireServer("key1234") --keys are an important check so that exploiters can't exploit your game
end)
then you made a server script of the remoteevent fired that will add points when you lick
game.ReplicatedStorage.yourremotename.OnServerEvent:Connect(function(player,key) -- the player is automaticly a thing
if key == "key1234" --check if it isnt an exploiter
--change ur lick value
end
end)
The server should manage the single source of truth regarding “licks”, coins, etc. Since the tool that handles user input is on the client, you will need to use remote events to communicate user input to the server.
here is a mockup
-- SERVER
local playerTable = {}
game.Players.PlayerAdded:Connect(function(player)
-- port in information from your datastores
playerTable[player] = {Licks = 0, Coins = 0,}
end)
-- add rate limiting to prevent exploiters from abusing your remote event
lickRemote.OnServerEvent:Connect(function(player)
playerTable[player].Licks = playerTable[player].Licks + 1
end)
-- CLIENT
-- tool is activated
lickRemote:FireServer()
It is also true that you can use value objects to store this information. Nevermore has a datastore module that will conveniently automatically save changes to value objects to roblox datastores. However, client changes to value objects will not replicate, so you must increment them on the server, which brings us back to needing remote events.
Hmmm, So this tables is like Extended one, but for General part of the game?, like this stores everything Licks,Coins and i can add gems right? and does the keys that BasedKnowledge advice still requires?
That’s neccessary, it’s because when you don’t have keys, exploiters can easily execute lickRemote:FireServer()
and it will add up the value without anything stopping it
it is dangerous when they do loop the script to get high amount of licks
like example
for i = 1,9999999999999999, 1 do
lickRemote:FireServer()
end
--the exploiter will get 9999999999999999 lick
but when you have keys, lickRemote:FireServer("keys1234")
and the exploiter try to run the remote lickRemote:FireServer()
It will not pass through the check because there are no args
What you did wrong was changing the value of the GUI that is in StarterGui.
What you want is to change the value of the Player’s GUI.
like this
change your gui.Frame.LP.Text = licks
to player.PlayerGui.Number.Frame.LP.Text = licks
Wait I Fixed it now, i remove the local lick and turn it to normal playerTable[player].Licks then it works!
now i’m gonna test it out if the data store works but how do i make the Lp part
updates when the player joins in? because i tried it its 0 until i clicked something and another problem came up, when i clicked multiple times and the animations did just 1 try i got multiple LP points, like if i click 5x rapidly later on i got 5 points even the animation just did 1 how do i fix this
So you don’t want the clicks to be faster than your animation?
Then make a cooldown on your localscript
local tool = script.Parent
local rp = game.ReplicatedStorage
local cooldown = false
tool.Equipped:Connect(function()
tool.Activated:Connect(function()
if cooldown = false then
cooldown = true
rp.Licktrigger:FireServer("lickmeme")
wait(1) --change the value depending on how long ur animation is
cooldown = false
end
end)
end)
Nc but now how can i make the Lp points always get updated when players join because i tried, its just empty but when i click the original number of their licks will came up like this