OrbTanT Posted July 7, 2014 Share Posted July 7, 2014 hi guys, anyone could spawn a script type with: sawn off, deagle, m4. more when the person dies it respawn with another type of pack: deagle, combat shotgun, ak47. already tried some ways most have not had results, use a simple system to respawn. local spawnX, spawnY, spawnZ = 2030.22, -1418.29, 16.99 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Bem Vindo", source) end addEventHandler( "onPlayerJoin", getRootElement(), joinHandler) addEventHandler( "onPlayerWasted" , getRootElement ( ), function() setTimer( spawnPlayer, 5000, 1, source, 2030.22, -1418.29, 16.99 ) end ) Link to comment
Max+ Posted July 8, 2014 Share Posted July 8, 2014 setTimer( spawnPlayer, 5000, 1, source, spawnX, spawnY, spawnZ ) Link to comment
OrbTanT Posted July 8, 2014 Author Share Posted July 8, 2014 need to spawn the weapon Link to comment
Max+ Posted July 8, 2014 Share Posted July 8, 2014 what do you want to do ? and if there is another code to give weaopns , post it Link to comment
OrbTanT Posted July 8, 2014 Author Share Posted July 8, 2014 like a pack of weapons spawn with ai pack that comes deagle, sawnoff, and m4's when the player is killed he the spawn with another random type pack, now with deagle, combat shotgun, ak47. Link to comment
Max+ Posted July 8, 2014 Share Posted July 8, 2014 addEventHandler ( 'onPlayerJoin', root, function ( ) spawnPlayer ( source, 2030.22, -1418.29, 16.99 ) fadeCamera( source, true ) setCameraTarget ( source, source ) outputChatBox ( ' Bem Vindo', source, 255, 255, 0 ) giveWeapon ( source, 31, 200 ) -- Gives the M4 weapon with 200 ammo giveWeapon ( source, 26, 200 ) -- Gives the sawnoff weapon with 200 ammo giveWeapon ( source, 24, 200 ) -- Gives the deagle weapon with 200 ammo end ) addEventHandler( "onPlayerWasted" , root, function() setTimer( spawnPlayer, 5000, 1, source, 2030.22, -1418.29, 16.99 ) triggerEvent ( 'onNextSpawn',source ) --- trigger the other pack and take the old pack end ) addEvent('onNextSpawn', true ) addEventHandler ( 'onNextSpawn', root, function ( ) giveWeapon ( source, 27 , 200 ) giveWeapon ( source, 30, 200 ) giveWeapon ( source, 24, 200 ) takeWeapon ( source, 31) takeWeapon ( source, 26) takeWeapon ( source, 24) outputChatBox(' * Weapons has beeen replaced * ' ,source, 255, 0 , 0 ) end ) Link to comment
OrbTanT Posted July 8, 2014 Author Share Posted July 8, 2014 Thanks helped me a lot, more so if I want the event onPlayerWasted have more than one option pack weapons? type using the math.random. Link to comment
Max+ Posted July 8, 2014 Share Posted July 8, 2014 yeah but you need to make a tabel for the weaopns , then use math.random 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