Jump to content

Ayuda Vida


Plate

Recommended Posts

Hola podria esto funcionar? es para agregar el item de Vida a mi inventario

function itemHealth() 
local itemH = getElementData(localPlayer, "Itemh") 
if itemH > 0 then 
local row = guiGridListAddRow(itemGrid) 
guiGridListSetItemText ( itemGrid, row, 1, "Vida + 50", false, false ) 
guiGridListSetItemText ( itemGrid, row, 2, tonumber(itemH)..", false, false ) 
end 
end 
  
  
 

Link to comment
function useItemHealth() 
            local row, col = guiGridListGetSelectedItem ( itemGrid ) 
            if ( row and col and row ~= -1 and col ~= -1 ) then 
                local itemH = guiGridListGetItemText ( itemGrid, row, 1 ) 
if (itemH == "Vida") then 
setElementHealth(localPlayer, 100) 
end 
end 
end 
addEventHandler("onClientGUIClcik", Usar, useItemHealth, false) 

Link to comment

Estas seguro que en el row dice 'Vida' no?

Igual proba asi:

function useItemHealth() 
if source == Usar then 
            local row, col = guiGridListGetSelectedItem ( itemGrid ) 
            if ( row and col and row ~= -1 and col ~= -1 ) then 
                local itemH = guiGridListGetItemText ( itemGrid, row, 1 ) 
if (itemH == "Vida") then 
setElementHealth(localPlayer, 100) 
end 
end 
end 
end 
addEventHandler("onClientGUIClick", root, useItemHealth) 

Link to comment
  • Recently Browsing   0 members

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