Jump to content

Ayuda con comando


Recommended Posts

Hola me pueden ayudar es que estoy tratando de hacer un contador de arrestos y como test quiero hacer esto pero no me funciona me aparece

attempt to perform arithmetic on local 'point' (a nil value)

function asd(player) 
ap = getElementData(player,"arrests") 
local point = tonumber(ap) 
setElementData(player,"arrests", point + 1) 
end 
addCommandHandler("holaxd", asd) 
  

Link to comment

Supongo yo que en alguna parte del script tu les pones ese element data, sino por eso te da error.

Prueba esto:

function asd(player) 
    local ap = getElementData(player, "arrests") 
    local point = tonumber(ap) or 0 
    setElementData(player,"arrests", point + 1) 
end 
addCommandHandler('holaxd', asd) 

Link to comment
Supongo yo que en alguna parte del script tu les pones ese element data, sino por eso te da error.

Prueba esto:

function asd(player) 
    local ap = getElementData(player, "arrests") 
    local point = tonumber(ap) or 0 
    setElementData(player,"arrests", point + 1) 
end 
addCommandHandler('holaxd', asd) 

Sisi es un test para el contador y gracias si funciono :D

Link to comment
  • Recently Browsing   0 members

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