Duff1995 Posted January 15, 2023 Share Posted January 15, 2023 -- Retorna um valor Numérico, se o jogador possuí o item retorna a quantidade -- que ele possuí, caso contrário retorna 0. --local next = exports.n3xt_inventario --local item = next:getItem(source, "Chocolate") --if (item) and (item >= 1) then -- -- Seu código aqui. --end function fabricarak () if (next:getSpaceMochila(source, "Corpo de AK-47", 1) == true) then local item = next:getItem(source, "Corpo de AK-47") local item = next:getItem(source, "Molas") if (item) and (item >= 1) then next:takeItem(source, "Corpo de AK-47", 1) next:takeItem(source, "Molas", 1) next:giveItem(source, "AK47", 1) end end end addEvent("fabricarakc",true) addEventHandler ( "fabricarakc", getRootElement(), fabricarak ) alguma ideia de como fazer isso funcionar corretamente? do jeito que está ele entrega a arma ao player mesmo ele não tendo todos os itens necessarios Link to comment
Moderators Vinyard Posted January 15, 2023 Moderators Share Posted January 15, 2023 Hi, Once again, your thread has been moved to the Portuguese section so you can get better assistance in your native language. Make sure to always use English when posting outside this language-specific section! Please take note: the scope of the Tutorials section is to post guides and tutorials regarding scripting-related aspects. It is not a section to seek scripting-related help! Link to comment
Blaack Posted January 15, 2023 Share Posted January 15, 2023 3 hours ago, Duff1995 said: -- Retorna um valor Numérico, se o jogador possuí o item retorna a quantidade -- que ele possuí, caso contrário retorna 0. --local next = exports.n3xt_inventario --local item = next:getItem(source, "Chocolate") --if (item) and (item >= 1) then -- -- Seu código aqui. --end function fabricarak () if (next:getSpaceMochila(source, "Corpo de AK-47", 1) == true) then local item = next:getItem(source, "Corpo de AK-47") local item = next:getItem(source, "Molas") if (item) and (item >= 1) then next:takeItem(source, "Corpo de AK-47", 1) next:takeItem(source, "Molas", 1) next:giveItem(source, "AK47", 1) end end end addEvent("fabricarakc",true) addEventHandler ( "fabricarakc", getRootElement(), fabricarak ) alguma ideia de como fazer isso funcionar corretamente? do jeito que está ele entrega a arma ao player mesmo ele não tendo todos os itens necessarios function fabricarak () if (next:getSpaceMochila(source, "Corpo de AK-47", 1)) then local item = next:getItem(source, "Corpo de AK-47") local item2 = next:getItem(source, "Molas") if (item) and (item >= 1) and (item2) and (item2 >= 1) then next:takeItem(source, "Corpo de AK-47", 1) next:takeItem(source, "Molas", 1) next:giveItem(source, "AK47", 1) end end end addEvent("fabricarakc",true) addEventHandler ( "fabricarakc", getRootElement(), fabricarak ) Creio que isso ira funcionar... 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