Lloyd Logan Posted January 5, 2013 Posted January 5, 2013 How do i make it so that when a player dies, they have to wait until everyone dies except one player (thesurvivor), then everyone spawns together? Thanks Lloyd
TAPL Posted January 5, 2013 Posted January 5, 2013 How will thesurvivor be selected, i mean how you will make the script select thesurvivor? What about if thesurvivor dead before everyone? -- Server Side -- -- thesurvivor should be defined somewhere. addEventHandler("onPlayerWasted", root, function() local alivePlayers = getAlivePlayers() if source == thesurvivor then -- thesurvivor dead, do something.. elseif #alivePlayers == 1 and alivePlayers[1] == thesurvivor then -- everyone dead, except thesurvivor. for i, player in ipairs(getElementsByType("player")) do -- get all players. spawnPlayer(player, x, y, z) -- spawn all players. setCameraTarget(player) -- make the camera follow him. end end end)
Lloyd Logan Posted January 5, 2013 Author Posted January 5, 2013 How will thesurvivor be selected, i mean how you will make the script select thesurvivor?What about if thesurvivor dead before everyone? -- Server Side -- -- thesurvivor should be defined somewhere. addEventHandler("onPlayerWasted", root, function() local alivePlayers = getAlivePlayers() if source == thesurvivor then -- thesurvivor dead, do something.. elseif #alivePlayers == 1 and alivePlayers[1] == thesurvivor then -- everyone dead, except thesurvivor. for i, player in ipairs(getElementsByType("player")) do -- get all players. spawnPlayer(player, x, y, z) -- spawn all players. setCameraTarget(player) -- make the camera follow him. end end end) So is this a valid script or just an "along the lines" example?
TAPL Posted January 5, 2013 Posted January 5, 2013 So is this a valid script or just an "along the lines" example? How will thesurvivor be selected, i mean how you will make the script select thesurvivor?What about if thesurvivor dead before everyone?
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