Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

When creating 'leaderstats' if I add a wait it does not show up?

I need to add this wait to allow other scripts to generate their leaderstats before mine, and I don't know what those scripts are as this will be a public script, so when I attempt to do:

local leaderstats = player:FindFirstChild("leaderstats");
local moneyStat = player:FindFirstChild(settings["MoneyName"]);
		
if (leaderstats == nil) then
	leaderstats = Instance.new("IntValue", player);
	leaderstats.Name = "leaderstats";
end

if (moneyStat == nil) then
	moneyStat = Instance.new("IntValue", leaderstats);
	moneyStat .Name = settings["MoneyName"];
end

It works fine as the 'leaderstat' and the moneyStat IntValue are inside the player but they do not show up for the player's leaderboard.

1 comment

0

Make all the stats in one script. That will fix you issue.

1 answer

Trying reading over this.

http://wiki.roblox.com/index.php?title=Leaderboard

Also, you are trying to find local leaderstats = player:FindFirstChild("leaderstats"); before it is even created. That could be part of the issue.

1 comment

1

:FindFirstChild will always return, it will not error, it will simply return nil.

This discussion is preserved as it was. New answers, comments, and votes are closed.