#Updating custom Gui for security

1 messages · Page 1 of 1 (latest)

steep raptor
#

is it safe to reference the leaderstat inside the localscript(for gui) like this

local coins = game.Players.LocalPlayer.leaderstats.coins

coins.Changed:Connect(function()
    coinGui.Text = `Coins: {coins.Value}`
end)

Or should i be using a remote event to update it instead?

neon cedarBOT
#

studio** You are now Level 1! **studio

clear coral
#

you should use WaitForChild though on the leaderstats

steep raptor
#

sorry if this was a stupid question

fair warren
#

not at all

steep raptor
#

ok so the gui is only referencing the leaderstat not actually changing it i was just wondering for datastore in particular - it will read the

coins.Value

and save it but i was wondering would someone trying to hack be able to change that value?

fair warren
#

as long as you're saving / loading just from the server, you're fine

#

the client CAN change the value, but it's only for them, it won't affect the server

#

so it won't be saved/processed by the server at all

steep raptor
#

okkk sweet cheers i was only wondering i was actually watching a tutorial for profilestore and they said use a remote event to update UI elements so i had to ask

fair warren
#

you don't need to use a remoteEvent necessarily if you're storing data in value objects tbh

#

cause the client can see those easily

clear coral
steep raptor
#

sweet^

#

so i already used it correctly