LucasBaker Posted November 25, 2013 Share Posted November 25, 2013 Why not work? function spawnArmas (player) giveWeapon ( player, 24, 200 ) - Desert Eagle giveWeapon ( player, math.random(26,27), 200 ) - Sawn ou Spaz giveWeapon ( player, math.random(30,31), 200 ) - M4 ou AK end addEventHandler ( "onPlayerSpawn", getRootElement(), spawnArmas ) Link to comment
TAPL Posted November 25, 2013 Share Posted November 25, 2013 function spawnArmas() giveWeapon(source, 24, 200) - Desert Eagle giveWeapon(source, math.random(26,27), 200) - Sawn ou Spaz giveWeapon(source, math.random(30,31), 200) - M4 ou AK end addEventHandler("onPlayerSpawn", getRootElement(), spawnArmas) Link to comment
Chronic Posted November 25, 2013 Share Posted November 25, 2013 Comments are written with -- so it should look like function spawnArmas (player) giveWeapon ( player, 24, 200 ) -- Desert Eagle giveWeapon ( player, math.random(26,27), 200 ) -- Sawn ou Spaz giveWeapon ( player, math.random(30,31), 200 ) -- M4 ou AK end addEventHandler ( "onPlayerSpawn", getRootElement(), spawnArmas ) Link to comment
LucasBaker Posted November 25, 2013 Author Share Posted November 25, 2013 (edited) function spawnArmas() giveWeapon(source, 24, 200) - Desert Eagle giveWeapon(source, math.random(26,27), 200) - Sawn ou Spaz giveWeapon(source, math.random(30,31), 200) - M4 ou AK end addEventHandler("onPlayerSpawn", getRootElement(), spawnArmas) in / debugscript gets this error thankss Edited November 25, 2013 by Guest Link to comment
Chronic Posted November 25, 2013 Share Posted November 25, 2013 This Comments are written with -- so it should look like function spawnArmas (player) giveWeapon ( player, 24, 200 ) -- Desert Eagle giveWeapon ( player, math.random(26,27), 200 ) -- Sawn ou Spaz giveWeapon ( player, math.random(30,31), 200 ) -- M4 ou AK end addEventHandler ( "onPlayerSpawn", getRootElement(), spawnArmas ) Link to comment
TAPL Posted November 26, 2013 Share Posted November 26, 2013 That's right @Chronic, but first parameter for event the onPlayerSpawn is position X not a player. function spawnArmas() giveWeapon(source, 24, 200) -- Desert Eagle giveWeapon(source, math.random(26,27), 200) -- Sawn ou Spaz giveWeapon(source, math.random(30,31), 200) -- M4 ou AK end addEventHandler("onPlayerSpawn", getRootElement(), spawnArmas) Link to comment
Chronic Posted November 26, 2013 Share Posted November 26, 2013 That's right @Chronic, but first parameter for event the onPlayerSpawn is position X not a player. function spawnArmas() giveWeapon(source, 24, 200) -- Desert Eagle giveWeapon(source, math.random(26,27), 200) -- Sawn ou Spaz giveWeapon(source, math.random(30,31), 200) -- M4 ou AK end addEventHandler("onPlayerSpawn", getRootElement(), spawnArmas) Ah yes you're right, I was just giving the solution to his debug error 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