Whizz Posted October 11, 2023 Posted October 11, 2023 Hello . What is this problem? The player does not receive weapons after the review. addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then giveWeapon(Player23, 31, 500) setTimer(spawnPlayer, 3000, 1, player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) elseif spawn23 == 2 then giveWeapon(Player23, 31, 500) setTimer(spawnPlayer, 3000, 1, player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) elseif spawn23 == 3 then giveWeapon(Player23, 31, 500) setTimer(spawnPlayer, 3000, 1, player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) end end end )
alex17" Posted October 11, 2023 Posted October 11, 2023 (edited) addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then setTimer(function() spawnPlayer(player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) elseif spawn23 == 2 then setTimer(function() spawnPlayer(player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) elseif spawn23 == 3 then setTimer(function() spawnPlayer(player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) end end end ) Edited October 11, 2023 by alex17"
Whizz Posted October 12, 2023 Author Posted October 12, 2023 18 hours ago, alex17" said: addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then setTimer(function() spawnPlayer(player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) elseif spawn23 == 2 then setTimer(function() spawnPlayer(player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) elseif spawn23 == 3 then setTimer(function() spawnPlayer(player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) end end end ) But that didn't work.
Spakye Posted October 12, 2023 Posted October 12, 2023 (edited) giveWeapon(player23,...) instead of Player23 Edited October 12, 2023 by Spakye
alex17" Posted October 12, 2023 Posted October 12, 2023 9 hours ago, Commonist said: But that didn't work. my bad addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then setTimer(function() spawnPlayer(player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) elseif spawn23 == 2 then setTimer(function() spawnPlayer(player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) elseif spawn23 == 3 then setTimer(function() spawnPlayer(player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) end end end ) 1
Whizz Posted October 14, 2023 Author Posted October 14, 2023 On 12/10/2023 at 22:28, alex17" said: my bad addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then setTimer(function() spawnPlayer(player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) elseif spawn23 == 2 then setTimer(function() spawnPlayer(player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) elseif spawn23 == 3 then setTimer(function() spawnPlayer(player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) end end end ) But this player sometimes does not spawn.
alex17" Posted October 14, 2023 Posted October 14, 2023 2 hours ago, Commonist said: But this player sometimes does not spawn. if teamDM == DeathMatch then you have an if, if the condition is not met it will not spawn
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