game.Players.PlayerAdded:connect(function(plr) local stats = Instance.new("IntValue", plr) stats.Name = "leaderstats" local Cash = Instance.new("IntValue", stats) Cash.Value = 0 Cash.Name = "Cash" end) while true do wait(1.5) game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 100 print("Given You 100$") end
I tried with a localscript/script
and dont work
(Tycoon game)
If you still don't understand im talking about it works in roblox studio but when join as a player not studio mode the leader-board don't show up
You should just give values for the player. dont do it for every player if your going to use a LocalPlayer. because each localscript that goes into specific services is cloned into each player
local plr = game.Players.LocalPlayer local stats = Instance.new("IntValue", plr) stats.Name = "leaderstats" local Cash = Instance.new("IntValue", stats) Cash.Value = 0 Cash.Name = "Cash" while true do wait(1.5) plr.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 100 print("Given You 100$") end