Jump to content

[HElP] GiveWeapon


Whizz

Recommended Posts

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
)
Link to comment
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 by alex17"
Link to comment
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.

Link to comment
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
)

 

  • Like 1
Link to comment
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.
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...