Volkszera Posted January 4, 2021 Share Posted January 4, 2021 Preciso de ajuda com um script que tenho, quando o player morre ele não perde nenhum item, porem tem a função, queria que quando o player morrer perder tudo que tem na bag function takeAllItem(element, itemID, itemValue) if not mysqlConnection then return end local playerItems = getElementItems(element, element, 0) for k, v in ipairs(playerItems["bag"]) do if (tonumber(v["id"]) == itemID) and (tonumber(v["value"]) == itemValue)then deleteItem(element, element, v["dbid"]) end end for k, v in ipairs(playerItems["key"]) do if (tonumber(v["id"]) == itemID) and (tonumber(v["value"]) == itemValue) then deleteItem(element, element, v["dbid"]) end end for k, v in ipairs(playerItems["cards"]) do if (tonumber(v["id"]) == itemID) and (tonumber(v["value"]) == itemValue) then deleteItem(element, element, v["dbid"]) end end getElementItems(element, element, 1) end addEvent("takeAllItem", true) addEventHandler("takeAllItem", getRootElement(), takeAllItem) Link to comment
Other Languages Moderators Lord Henry Posted January 6, 2021 Other Languages Moderators Share Posted January 6, 2021 Formate seu tópico da maneira adequada. Veja as regras aqui: Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now