I’m making a TDM Gamemode from scratch, and I have most of it done. But I can’t figure out how to make a score system! I wanted it to be like something in the top of the screen that says how many kills each team has and when it reaches a set amount, say 30 kills for one team, it ends the round. And after so many rounds, it switches maps? Is this possible, if so, can someone please help me with it?!
[editline]14th December 2014[/editline]
Anybody? Please? I need this ASAP!
If you’ve made a round system, create a timer on whatever start function you’ve got to go through players and check if their frags() are equal or greater than 30, if so do whatever
A lot of round systems like Fretta use GetGlobalInt as a tracking method for rounds
Thanks, but…I don’t really know how to make it…
Could you help me out a bit with it?
How could you have made a decent gamemode without knowing how to use timers, if statements, or checking team frags? Even I know how to do that, and according to The Best Lua coder ever, Exho, I am a lua scrub lorde.
You should get the team frags and check if they are equal to thirty
if team.TotalFrags (1) == 30 then
Use something like that on player death to check when a player dies if the round should end. Just make a Hud element for the kills display, If you know basic lua this should be easy.
Okay, thanks but…
I’m VERY bad at making HUDs and the kill display. So I was kind of hoping if someone could like, give an example code instead of one line?
Sorry if I sound like a jerk. But I really need help with this.
I’d recommend using PlayerDeath hook to count team frags. Also, On Player changed team or disconnect you may want to reset the player kills and subtract the amount from the team kills or just leave it as is.
When a team has 30 kills ( checking in PlayerDeath ) then fire the round-over hook.
Here’s a basic example of managing who has the most kills and networking it to the client when the most kills player and count changes. Also, at the end of the round it’ll show the player with the most kills for 5 seconds: https://dl.dropboxusercontent.com/u/26074909/tutoring/_random/manage_mostkills_and_show_at_round_end.lua