Hello. I am making a fighting game so obviously there should be a kill leaderboard in the top right corner. But I don’t even know the first thing about how to make a leaderboard.
What I want is a “Kills”, “Wins”, and “Coins” Leaderboard with the “Wins” determining the placement on the playerlist (determining if you belong in the lowest or highest part in the playerlist).
If you can script the “Kills” Leaderboard to actually make it take kills AND BE ABLE TO SAVE…Thank heaven if you do that It would be very much appreciated by me. But this is a side problem that may get bigger later so dont worry about it
game.Players.PlayerAdded:Connect(function(player)
-- This must be named leaderstats in order to work
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local Money = Instance.new("IntValue")
Money.Name = "Money"
Money.Parent = leaderstats
-- Replace money with whatever you want it to be
end)
For every time a player has their character added/respawned you would want to look for their Humanoid object and listen for the Died event. If you’re using tools that have common scripts like swords then this should be easy to implement.
When a character receives damage from a tool that uses these common scripts a object is created called “creator” which is a ObjectValue where the Value is the player that has given the damage.
So as a quick pseudo/example:
Sorry that I didn’t provide the example directly into the post because the formatting for codeblocks seem to be broken.
Now for the logic of the area where it says the player was killed by another player you would do