Jump to content

Table Weapon


OrbTanT

Recommended Posts

I would like to create a table, of the type that the player after that die, give spawn with one of those pack, more I am not able to create this table.

pack weapon = { 
( 24, 26, 31), -- weapons IDS = Desert Eagle, Sawn Off, M4 
( 24, 27, 31), -- weapons IDS = Desert Eagle, Combat Shotgun, M4 
( 24, 26, 28, 31) -- weapons IDS = Desert Eagle, Sawn Off, Uzi, M4 
} 

Link to comment

I tried to make the script work in this way, most had no results, shows the giveweapon bad argument 1.

table = { 
{24, 26 ,31}, 
{24, 27, 31} 
} 
  
function weapon() 
    local gRandom = math.random(#table) 
    for placeNumber, weaponData in ipairs(table[gRandom]) do 
        giveWeapon(player, weaponData, ammo, current) 
    end 
end 
addEventHandler("onPlayerWasted", getRootElement(), weapon) 

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...