How would you make a most kills script/Gui?

Ok, ok, I know this isn’t in the right category but I’m not a regular, so I can’t post in Discussions. Anyway, I was wondering how to make a most kills gui pop up after the game timer ends, and shows the avatar, the name, and the number of kills. I am not asking for entire script, just things that could help me make an entire script. Thanks!

This doesn’t go in discussion? Why would you put it there? You put script in the title, so I think it belongs here.

Anyways…

How would people kill each other? We can’t see who killed each other without making a value of who did. When you kill someone, insert an object value into the player you killed called something like

“KilledBy”

and set the value to the player who has the weapon.

Then hook up a Humanoid.Died event to a players humanoid like this:

game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
char:WaitForChild("Humanoid").Died:Connect(function()
--do stuff
end)
end)
end)

In already have a kills leaderstats

Oh okay. Well then, what do you need? A global leaderboard?

Create 2 values, one called mostKillsCount and another called mostKillsPlayer. Iterate through everyone’s kills at the end of the round and if their kills is greater than mostKillsCount, set the value of mostKillsCount to their kills and set the value of mostKillsPlayer to their player. Then do whatever you need to with these values and pop up a gui, etc.

So basically check which player has the most kills? (In that round)

Yes, that is basically what you want to do.

Could you show me an example script of what you are talking about? (Sorry I’m a beginner scripter, so I need assistance on these kind of things.)

Does anyone else have any other suggestions?

try this

local relativePos = part.CFrame:pointToObjectSpace(humanoidRootPart.Position)
if math.abs(relativePos.X) <= part.Size.X * 0.7 * 0.5 and math.abs(relativePos.Z) <= part.Size.Z * 0.7 * 0.5 then
    print("inside")
end

Ok, never mind, try a VARIATION of this script, make it run when a player is dead, and make it define the dead player. I don’t entirely know how this script works. if i did, i would fix it, but i got if from here if you want to check it out.