Volkszera Posted January 4, 2021 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)
Moderators Lord Henry Posted January 6, 2021 Moderators Posted January 6, 2021 Formate seu tópico da maneira adequada. Veja as regras aqui: Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
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