Leaderstats script not working

leaderstats script not working?

You need to give us more information about your problem, other than the fact that something is not working.

1 Like

There is no information provided, so how can we help you? Also, please read this before making a post, as it will give you a basic understanding on what information to include in your post.

this is the script i made for the leaderstats game.Playeradded:connect(function(player)
end)
local leaderstats = Instance.new(“Model”)
leaderstats.Name = leaderstats
leaderstats.Parent = player

local money =Instance.new(“IntValue”)
money.name = coins
money.Parent = leaderstats

local strength = Instance.new(“IntValue”)
strength.name = strength
strength.Value = 0
strength.Parent = leaderstats

game.Players.PlayerAdded bruh,

3 Likes

money.Name and strength.Name, name is case sensitive so it can’t just be “name” needs a uppercase N

First of all, leaderstats should be a Folder not a Model. Also, when changing the names they should be assigned to strings, such as leaderstats.Name = “leaderstats”.

game.Players.PlayerAdded:Connect(function(player)

	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local money =Instance.new("IntValue")
	money.Name = "Coins"
	money.Parent = leaderstats
	
	local strength = Instance.new"IntValue"
	strength.Name = "Strength"
	strength.Value = 0
	strength.Parent = leaderstats
	
end)
2 Likes

Remember to give script as Script Font, i will read ur letter sandwich.

Your leaderstats are and old script, and some things are wrong.

New script:

local function MakeLeaderboards(Player)
	local StartingCash = 150 -- Starting cash in your game
	local StartingStrength = 100 -- Starting strength in your game
	
	local Leaderstats = Instance.new("Folder") -- Creates a folder in the player
	Leaderstats.Name = "leaderstats" -- Name of the folder
	Leaderstats.Parent = Player -- Parent of the folder
	
	local Money = Instance.new("IntValue") -- Creates a IntValue in the Leaderstats
	Money.Name = "Money" -- Name of the money
	Money.Parent = Leaderstats -- Parent of the money
	Money.Value = StartingCash -- Value of the money
	
	local Strength = Instance.new("IntValue") -- Creates a IntValue in the Leaderstats
	Strength.Name = "Strength" -- Name of the strength
	Strength.Parent = Leaderstats -- Parent of the strength
	Strength.Value = StartingStrength -- Value of the strength
end

game.Players.PlayerAdded:Connect(MakeLeaderboards)

Remember to mark me as Solution if this helped.

Please follow the guidelines when creating topics.