Lloyd Logan Posted January 5, 2013 Share 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 Link to comment
TAPL Posted January 5, 2013 Share 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) Link to comment
Lloyd Logan Posted January 5, 2013 Author Share 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? Link to comment
TAPL Posted January 5, 2013 Share 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? Link to comment
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