Weird problem with simple script

Hello everyone, I have this script that creates values for guns and leaderstats:

game.Players.PlayerAdded:Connect(function(plr)
	local leaderstats = Instance.new("Folder", plr)
	leaderstats.Name = "leaderstats"
	
	local money = Instance.new("IntValue", leaderstats)
	money.Name = "Credits"
	
	local guns = Instance.new("Folder", plr)
	guns.Name = "Guns"
	
	local bowcaster = Instance.new("BoolValue", guns)
	bowcaster.Name = "Bowcaster"
	print(bowcaster.Name)
	
	local charric = Instance.new("BoolValue", guns)
	bowcaster.Name = "Charric"
end)

But then something really weird happens, even though the print prints the correct name I get this:
image

Parent it after you’ve assigned objects as that is faster than using the parent method with Instance.new().

1 Like

image Change The Second bowcaster to charric and it should be solved

3 Likes

What a dumb error :sweat_smile: