Leaderstats isn't creating an IntValue

Question 1 : I want to get a Leaderstats to create an IntValue

Question 2 : Leaderstats isn’t creating IntValue

Question 3 : I’m trying to change from “game.Players.PlayerAdded(function(player)” to “game.Players.LocalPlayer”, And trying to use your assistant, And trying to view other’s forums

My leaderstats script (Not LocalScript it’s a Script)

game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "Leaderstats"
	leaderstats.Parent = player
	
	local coins = Instance.new("IntValue")
	coins.Name = "Coins"
	coins.Value = 0
	coins.Parent = leaderstats
	
	local gems = Instance.new("IntValue")
	gems.Name = "Gems"
	gems.Value = 0
	gems.Parent = leaderstats
end)

I know it’s look normal but it didn’t work

Video (Streamable) : robloxapp-20240113-2201455
Script (Streamable) :image_2024-01-13_220432392

1 Like

its leaderstats, not Leaderstats as for the Name

2 Likes

Silly mistake, i do it sometimes.

i dont think that is a good idea

Yes the “Leaderstats” got ya… Hate that.

--Get the Player and Character in a server script
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		--
	end)
end)

--Get the Player and Character in a client script
local player: Player = game:GetService("Players").LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
1 Like

if you wanna do number leaderstats values perhaps use NumberValue instead of IntValue

oh also its called leaderstats not Leaderstats, uncap the L

1 Like

Hi!

You did a small mistake.

You’re naming the leaderstats to “Leaderstats” while you have to name it to “leaderstats” :slight_smile:

1 Like

its leaderstats with an lowercase L, and not “Leaderstats” as the leaderstats name.

1 Like

NumberValues are just there so you can have decimals, IntValues are there for a whole Intergers, so both work good

1 Like

Thank you, It works now, You are my solution now :slight_smile:

That’s familar to my posts, That is my first post tho

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.