Server side script that adds the leaderstats values:
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local wave = Instance.new("IntValue")
local coins = Instance.new("IntValue")
coins.Name = "Coins"
wave.Name = "Wave"
coins.Value = 0
wave.Value = 1
coins.Parent = leaderstats
wave.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
Local script that changes the leaderstats values based on what your Wave or Coins are:
local Update = true
local Wave = 1
local Coins = 100
local plrWave = game.Players.LocalPlayer.leaderstats.Wave
local plsCoins = game.Players.LocalPlayer.leaderstats.Coins
while Update == true do
plrWave.Value = Wave
plsCoins.Value = Coins
wait(0.1)
end
So these scripts work fine and change the leaderstats values for the player, but not for other players, i feel like this has something to do with the script that changes the values being a local script, but if someone could help me it would be much appreciated.

12 comments
you are changing the values on the client, change it on the server.
transfer the code from the local script to the server script. it will work the same way on the server, except you'll be abiding by the rules of FilteringEnabled.
Could you please explain how i would change it on the server instead of the client, like would i change it from game.Players.LocalPlayer to something else?
Oh srry i didnt see the message because i didnt refresh the page, and thank you for the help
instead of localplayer, use the player parameter inside your function
in your onPlayerJoin function, you have the player parameter. just use that!
^ do what gio said lol
Yeep, Local scripts are for local client things and normal scripts are for the server stuff thing thing stuff (I can't type)
its ok we all appreciate ur service gamergirl
Yeah lol i had figured the problem was it being a local script
This didnt work, i changed everything over to the server sided script and made LocalScript into player but it doesnt change the value now
I should also say that i need to be able to change the value of Wave when a gui is clicked, not asking for the script, just saying thios because it might be affecting something, thopugh i dont have that part in the server sided script right now