This works perfectly for rewarding the player when "Stage" is a multiple of 5, but the issue I've run into is that if a player is on stage 5 and continually reloads they'll keep being rewarded. is there a way i can make this function only applicable when changing, and not during initial "creation", or being pulled from the DataStore.
game.Players.PlayerAdded:Connect(function(plr)
local Leaderstats = plr:WaitForChild("leaderstats")
local Stage = Leaderstats:WaitForChild("Stage")
local Gems = plr:WaitForChild("Gems")
local Skips = plr:WaitForChild("Skips")
Stage.Changed:Connect(function(new)
if new % 5 == 0 then
Gems.Value = Gems.Value + 10
end
end)
end)

5 comments
Could you explain it a little better?
Instead of having a separate script do it all from one script. If that's your only script then a separate script is creating the leaderstats.
Okay let me merge together my Datastore script and this script, ill see if that works.
You're scary good at this inca. Problem is now resolved, but how was having them in different locations causing the issue?
Also please send an answer so i can mark it :) Thanks!!!