Jump to content

[Ayuda] Con Nombres


~Funky~

Recommended Posts

Hola a todos quisiera saber como obtener el nombre de una arma que este en una tabla, no se que funcion debo utilizar y como Unirlas D:

Aca la funcion que tengo

  
TablaWeapon = {31,29,38} 
TablaBalas = {500,100,90,80,758} 
  
  
setTimer(function (playerSource) 
for id, player in ipairs(getElementsByType("player")) do 
giveWeapon( player, TablaWeapon[math.random(1, #TablaWeapon)], TablaBalas[math.random(1, #TablaBalas)] ) 
outputChatBox ( "**Sistema Random : El Jugador "..getPlayerName(player) .." Ahora Tiene Una" " !", player, 255, 255, 255, true ) 
end 
end,60000,0)      
  

quiero que el outputChatBox me diga que armas me dio y sus balas me podrian ayudar D:

Link to comment

Lo Hice asi :

  
TablaWeapon = {31,29,38} 
TablaBalas = {500,100,90,80,758} 
  
  
setTimer(function (playerSource) 
local Arma = getWeaponNameFromID(playerSource) 
for id, player in ipairs(getElementsByType("player")) do 
giveWeapon( player, TablaWeapon[math.random(1, #TablaWeapon)], TablaBalas[math.random(1, #TablaBalas)] ) 
outputChatBox ( "**Sistema Random : El Jugador "..getPlayerName(player) .." Ahora Tiene Una".. Arma .."!", player, 255, 255, 255, true ) 
end 
end,5000,0) 
  

Pero Me manda este Error D:

Link to comment
TablaWeapon = {31,29,38} 
TablaBalas = {500,100,90,80,758} 
  
  
setTimer(function (playerSource) 
for id, player in ipairs(getElementsByType("player")) do 
local weap = TablaWeapon[math.random(1, #TablaWeapon)] 
giveWeapon( player, weap, TablaBalas[math.random(1, #TablaBalas)] ) 
outputChatBox ( "**Sistema Random : El Jugador "..getPlayerName(player) .." Ahora Tiene Una "..weap.. " !", player, 255, 255, 255, true ) 
end 
end,60000,0) 

Link to comment
TablaWeapon = {31,29,38} 
TablaBalas = {500,100,90,80,758} 
  
  
setTimer(function (playerSource) 
for id, player in ipairs(getElementsByType("player")) do 
local weap = TablaWeapon[math.random(1, #TablaWeapon)] 
giveWeapon( player, weap, TablaBalas[math.random(1, #TablaBalas)] ) 
outputChatBox ( "**Sistema Random : El Jugador "..getPlayerName(player) .." Ahora Tiene Una "..weap.. " !", player, 255, 255, 255, true ) 
end 
end,60000,0) 

en vez weap en el outputChatBox usa getWeaponNameFromID con weap

Link to comment
  • Recently Browsing   0 members

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