What is my error in my leaderstat script?

I am trying to get leaderstats in my testing place, but it does not work.

	local leaderstats = instance.new("Folder")
	leaderstats.Name = 'leaderstats'
	leaderstats.Parent = player
	
	local cash = Instance.new("IntValue")
	cash.Name = "Cash"
	cash.Value = 5000 --Gives the player that amount of cash upon joining
	cash.Parent = leaderstats
end)

Anyone know my issue?

You can capitalize the ‘i’ in your first ‘instance.new()’

And check the Output window to learn more about this problem and problems you encounter later

If you don’t get any errors but something doesn’t work, you can diagnose the problem by adding prints in various places to find out what part of your code isn’t behaving as expected

1 Like

Alright. Thanks for your help! Yea, I tried that. I think it bugged out because there was no errors.
I also completely forgot about doing print, ahhaha. Thanks again!

1 Like

Sometimes in studio PlayerAdded doesn’t fire your connection because your connection was made after you joined the game to test

If that’s ever the case, you can fix it by making your connection as well as looping through any players that have already joined and running the function for them

1 Like

Ok! Thanks for taking time out your day to help me! Much appreciated!

1 Like