I am making a tycoon with a leaderboard for cash.
-- leaderboard made by roboy5857 function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local Moneyz = Instance.new("IntValue") Moneyz.Name = "Moneyzz" Moneyz.Value = 5 Moneyz.Parent = stats end
It won't work, why?
Try this instead.
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local cash = Instance.new("IntValue") cash.Name = "Moneyzz" cash.Value = 5 cash.Parent = stats stats.Parent = newPlayer end game.Players.ChildAdded:connect(onPlayerEntered) --You forgot to connect the function like this above
Please note: That if you don't connect a function it's pretty much useless and it wouldn't work.