I'm trying to make a gamemode that has a time limit. When that time limit reaches 0 I want the game mode to show the highest scoring player. I already got it to show some text but I can't get the highest scoring player.
define "score"
The frags.
loop through player.GetAll
and check Player/Frags
highest_score, highest_ply = 0
for _, ply in pairs(player.GetAll()) do
if not IsValid(ply) then continue end
local score = ply:Frags()
if score > highest_score then
highest_score, highest_ply = score, ply
end
Thank you, it seems to have worked, I need to test it with more than one player to be sure.
I've updated the gist a couple of times, hope you noticed.
Yep. Thanks for all the help.
Sorry, you need to Log In to post a reply to this thread.