Author Topic: Change Slayer Pref on Minigame Death of Certain Team  (Read 1007 times)

Hello! I know the basics of changing slayer prefs but I have a problem. I want so that if a person from a team dies (Only one player is on that team.) it sets another team's life's to 1. I would love some help! Thanks!
Edit: I would also like to be able to set all teams life's back to -1 on round reset
« Last Edit: January 11, 2015, 07:11:38 PM by rggbnnnnn »


https://www.dropbox.com/s/vjjp6qy72v199lc/Server_TeamLifeTickets.zip?dl=0

Idk how well this plays with Slayer, if it doesn't then learn from it's code and adapt it to your needs.

Do you actually have any code for us to help with or is this a request? Sounds like you're making a gamemode, and in that case you shouldn't mess with the prefs, and instead just update the team members' lives.

Do you actually have any code for us to help with or is this a request? Sounds like you're making a gamemode, and in that case you shouldn't mess with the prefs, and instead just update the team members' lives.
Yes, I am making a gamemode. I just needed a small script so that the main feature would work. I need it so that when the person on both "V.I.P." teams dies, their regular team has one life.

Yes, I am making a gamemode. I just needed a small script so that the main feature would work. I need it so that when the person on both "V.I.P." teams dies, their regular team has one life.
You'll want a separate method to perform this check, that way you can also do it if the VIP leaves the minigame or disconnects. First use %VIPTeam.isTeamDead() to determine if the VIPs are dead. If so, take the protector team and loop through them, setting their lives to 1. You'll also want to decide what to do about people already dead when the VIP dies, either leave them dead or give them one last life. There's a bunch of other stuff you might want to do if you plan to release this, but one thing at a time.

Yeah. I need to take it one step at a time. I will start to script that but I have a download here to show what the game-mode is like and what I need help scripting. I will try to get the loop working though.

Description: V.I.P. is where each team has one player become a 'V.I.P.' The objective is to kill the other team's V.I.P. and then kill the rest of the team.

Download