One leaderstat changes while the other one doesnt

I want to be able to add “fortune” for my player but for some reason it doesnt work, then i tried it with the other leaderstat “coins” and it works. From what i can tell everthing looks the same in the script so shouldnt it behave so?

This is the leaderstat script (in server script service):

local players = game:GetService("Players")

function playerSpawned(player)
	local leaderstats = Instance.new("Folder", player)
	leaderstats.Name = "leaderstats"

	local coins = Instance.new("IntValue", leaderstats)
	coins.Name = "Coins"
	coins.Value = 0
	
	local fortune = Instance.new("IntValue", leaderstats)
	fortune.Name = "Fortune"
	fortune.Value = 0

end

players.PlayerAdded:Connect(playerSpawned)

What is the GUI Localscript where it updates the text?

Yeah i was about to get to that, the script where it gets displayed had a typo for the 2nd leaderstat, it didnt cross my mind because i was testing a shop gui and even though the value in leaderstat was up i couldnt buy anything, so now i know theres also a problem in the shop gui :confused: well im glad it wasnt a big deal

Turns out display was wrong (goofy mistake)
Fixed version:
image
Broken version:
image

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