TroyBoy Posted February 19, 2012 Share Posted February 19, 2012 how can i do that only after 2 seconds when i killed i will get spawn Link to comment
Paper Posted February 19, 2012 Share Posted February 19, 2012 setTimer spawnPlayer addEventHandler("onPlayerWasted", root, function) Link to comment
Evil-Cod3r Posted February 19, 2012 Share Posted February 19, 2012 fucntion whatever () -- function name local x, y, z = getElementPosition (source ) --- get Player Position spawnPlayer ( source, x, y, z) -- spawn the Player end -- close it setTimer ( whatever, 2000, 1) -- the timer 2 sec .. addEventHandler ( "onPlayerSpawn", getRootElement(), whatever) --- the event name Link to comment
Moderators IIYAMA Posted February 19, 2012 Moderators Share Posted February 19, 2012 --if you use this script above mind> fucntion whatever = function whatever (I post this at the sametime as his one I am a noob scipter... pls say If I do something wrong. I write it down like this: (it can be smaller) function Wasted () -- function Wasted <<< setTimer ( Wastedtimer, 2000, 0 ) -- this is the timer and will activate the second function. end addEventHandler("onPlayerWasted", root, Wasted) -- this checks when you die. "The Wasted" activate the function Wasted. function Wastedtimer () spawnPlayer ( source, 0.0, 0.0, 0.0, 0.0, 0 ) end --[[ just fill it in. (mind all players will be spawned at one location.) Required Arguments thePlayer: The player you want to spawn. x: The x co-ordinate to spawn the player at. y: The y co-ordinate to spawn the player at. z: The z co-ordinate to spawn the player at. Optional Arguments rotation: rotation of the player on spawn. skinID: player's skin on spawn. interior: interior the player will spawn into. dimension: The ID of the dimension that the player should be in. theTeam: the team the player will join. More info about spawning: https://wiki.multitheftauto.com/wiki/SpawnPlayer ]] Link to comment
drk Posted February 21, 2012 Share Posted February 21, 2012 (edited) --if you use this script above mind> fucntion whatever = function whatever (I post this at the sametime as his one I am a noob scipter... pls say If I do something wrong. I write it down like this: (it can be smaller) function Wasted () -- function Wasted <<< setTimer ( Wastedtimer, 2000, 0 ) -- this is the timer and will activate the second function. end addEventHandler("onPlayerWasted", root, Wasted) -- this checks when you die. "The Wasted" activate the function Wasted. function Wastedtimer () spawnPlayer ( source, 0.0, 0.0, 0.0, 0.0, 0 ) end --[[ just fill it in. (mind all players will be spawned at one location.) Required Arguments thePlayer: The player you want to spawn. x: The x co-ordinate to spawn the player at. y: The y co-ordinate to spawn the player at. z: The z co-ordinate to spawn the player at. Optional Arguments rotation: rotation of the player on spawn. skinID: player's skin on spawn. interior: interior the player will spawn into. dimension: The ID of the dimension that the player should be in. theTeam: the team the player will join. More info about spawning: https://wiki.multitheftauto.com/wiki/SpawnPlayer ]] I think it will work. But why you use an infinite timer? function spawnAgain() spawnPlayer( source, 0.0, 0.0, 0.0, 0.0, 0 ) end addEventHandler('onPlayerWasted',root, function() setTimer( spawnAgain, 2000, 1 ) end ) Edited February 21, 2012 by Guest Link to comment
Kenix Posted February 21, 2012 Share Posted February 21, 2012 Server function spawnAgain( player ) spawnPlayer( player, 0.0, 0.0, 0.0 ) end addEventHandler( 'onPlayerWasted',root, function( ) setTimer( spawnAgain, 2000, 1,source ) end ) Link to comment
Moderators IIYAMA Posted February 21, 2012 Moderators Share Posted February 21, 2012 It works, but why you need a infinite timer? Because I am still learning Link to comment
drk Posted February 21, 2012 Share Posted February 21, 2012 It works, but why you need a infinite timer? Because I am still learning Relax, no problem dude 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