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.