<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.starfall.wtf/index.php?action=history&amp;feed=atom&amp;title=Leaderboards</id>
	<title>Leaderboards - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.starfall.wtf/index.php?action=history&amp;feed=atom&amp;title=Leaderboards"/>
	<link rel="alternate" type="text/html" href="https://wiki.starfall.wtf/index.php?title=Leaderboards&amp;action=history"/>
	<updated>2026-07-28T17:10:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.starfall.wtf/index.php?title=Leaderboards&amp;diff=460&amp;oldid=prev</id>
		<title>PRG: Created page with &quot;{{CatUp|Tutorials}} __TOC__  == Introduction ==  This will show you how to make/edit the basic leaderboard.  It may be necessary, if you are interested in KO&#039;s and Wipeouts, to access the most recent leaderboard, found in GAME OBJECTS.  That leaderboard has a lot more scripting, but the additional script is dedicated to updating the KO&#039;s and Wipeouts.  You can still edit it if you want.  == The script ==  Eventually, you will find in any leaderboard script the following...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.starfall.wtf/index.php?title=Leaderboards&amp;diff=460&amp;oldid=prev"/>
		<updated>2024-12-10T21:55:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{CatUp|Tutorials}} __TOC__  == Introduction ==  This will show you how to make/edit the basic leaderboard.  It may be necessary, if you are interested in KO&amp;#039;s and Wipeouts, to access the most recent leaderboard, found in GAME OBJECTS.  That leaderboard has a lot more scripting, but the additional script is dedicated to updating the KO&amp;#039;s and Wipeouts.  You can still edit it if you want.  == The script ==  Eventually, you will find in any leaderboard script the following...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{CatUp|Tutorials}}&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This will show you how to make/edit the basic leaderboard.  It may be necessary, if you are interested in KO&amp;#039;s and Wipeouts, to access the most recent leaderboard, found in GAME OBJECTS.  That leaderboard has a lot more scripting, but the additional script is dedicated to updating the KO&amp;#039;s and Wipeouts.  You can still edit it if you want.&lt;br /&gt;
&lt;br /&gt;
== The script ==&lt;br /&gt;
&lt;br /&gt;
Eventually, you will find in any leaderboard script the following function &amp;quot;onPlayerEntered(newPlayer)&amp;quot; (or something similar).  That is where the individual statistics for each player are made.&lt;br /&gt;
&amp;lt;tt&amp;gt;function onPlayerEntered(newPlayer)&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is where all the important CUSTOM bits are made.  You can change almost all of it.  The code is in the format&lt;br /&gt;
&amp;lt;tt&amp;gt;local variableName = Instance.new(&amp;quot;IntValue&amp;quot;)&lt;br /&gt;
variableName.Name = nameIWantToAppearOnScreen&amp;lt;/tt&amp;gt;&lt;br /&gt;
The exception is the leaderstats variable.&amp;lt;br&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
	local stats = Instance.new(&amp;quot;IntValue&amp;quot;)&lt;br /&gt;
	stats.Name = &amp;quot;leaderstats&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
You CANNOT change the &amp;quot;leaderstats&amp;quot; unless you don&amp;#039;t want the variables inside it displayed on the leaderboard. Note that the leaderstats variable itself doesn&amp;#039;t show up.&lt;br /&gt;
So, if you wanted money, you&amp;#039;d do:&amp;lt;pre&amp;gt;&lt;br /&gt;
	local money = Instance.new(&amp;quot;IntValue&amp;quot;)&lt;br /&gt;
	money.Name = &amp;quot;Money&amp;quot;&lt;br /&gt;
	money.Value = &amp;quot;0&amp;quot;&lt;br /&gt;
	money.Parent = stats&amp;lt;/pre&amp;gt;&lt;br /&gt;
To access the money of, say &amp;quot;Bob&amp;quot;, you would use the command:&lt;br /&gt;
&amp;lt;tt&amp;gt;game.Players.Bob.leaderstats.Money.Value = game.Players.Bob.leaderstats.Money.Value + 1 --increment Bob&amp;#039;s money by 1.&amp;lt;/tt&amp;gt;&lt;br /&gt;
You could continue to add more features, such as captures, points, mana, power, level, stage, minutes at place, etc. The rest of the script is below, but it is copied from the basic leaderboard.&amp;lt;pre&amp;gt;&lt;br /&gt;
	-- VERY UGLY HACK&lt;br /&gt;
	-- Will this leak threads?&lt;br /&gt;
	-- Is the problem even what I think it is (player arrived before character)?&lt;br /&gt;
	while true do&lt;br /&gt;
		if newPlayer.Character ~= nil then break end&lt;br /&gt;
		wait(5)&lt;br /&gt;
	end&lt;br /&gt;
	local humanoid = newPlayer.Character.Humanoid&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assigning of Events ==&lt;br /&gt;
&lt;br /&gt;
If you want to, say, take away points every time the humanoid dies, you would need the following line:&lt;br /&gt;
&amp;lt;tt&amp;gt;	humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )&amp;lt;/tt&amp;gt;&lt;br /&gt;
Also, any other event of the humanoid can be put here, along with any other events related to the new player that aren&amp;#039;t handled in any other script in your place.  Just remember that the above line requires a special function &amp;quot;onHumanoidDied&amp;quot;, which is not in this script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;	-- start to listen for new humanoid&amp;lt;/tt&amp;gt;&lt;br /&gt;
The same applies to the following line: &amp;lt;pre&amp;gt;&lt;br /&gt;
	newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )&lt;br /&gt;
	stats.Parent = newPlayer --this part assigns the stats we made earlier to the player&lt;br /&gt;
end&lt;br /&gt;
game.Players.ChildAdded:connect(onPlayerEntered)&amp;lt;/pre&amp;gt;&lt;br /&gt;
It is absolutely necessary for that part of the script to be present.&lt;br /&gt;
&lt;br /&gt;
That should allow you to edit any leaderboard you like!&lt;br /&gt;
&lt;br /&gt;
== Complete leaderboard script ==&lt;br /&gt;
 &lt;br /&gt;
Here is an example of a complete leaderboard:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function onPlayerEntered(newPlayer)&lt;br /&gt;
	local stats = Instance.new(&amp;quot;IntValue&amp;quot;)&lt;br /&gt;
	stats.Name = &amp;quot;leaderstats&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	local c = Instance.new(&amp;quot;IntValue&amp;quot;)&lt;br /&gt;
	c.Name = &amp;quot;Money&amp;quot;&lt;br /&gt;
	c.Value = 0&lt;br /&gt;
&lt;br /&gt;
	c.Parent = stats&lt;br /&gt;
&lt;br /&gt;
	stats.Parent = newPlayer &lt;br /&gt;
&lt;br /&gt;
	newPlayer.Changed:connect(function (property)&lt;br /&gt;
		if (property == &amp;quot;Character&amp;quot;) then&lt;br /&gt;
			onPlayerRespawned(newPlayer)&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
game.Players.ChildAdded:connect(onPlayerEntered)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]]&lt;/div&gt;</summary>
		<author><name>PRG</name></author>
	</entry>
</feed>