-Blaze- Posted March 16, 2015 Posted March 16, 2015 Hello everybody , i'm trying to make a script where the last player in combat gets a reward. I'm using onVehicleExplode() to check on the number of alive players since it is a Shooter mode. How can i get the last player alive and set a variable to him so i may be able to give him money , exp ,etc.?
xXMADEXx Posted March 16, 2015 Posted March 16, 2015 Inside the event, you can check the table size to see how many players are remaining. If it's only one, you can access it with variable[1]. Example: local players = getAlivePlayers ( ); -- Get players if ( #players == 1 ) then -- only one player is remaining local player = players [ 1 ]; -- 'player' variable is the winning player end
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now