- 0
4 respostass a esta questão
Recommended Posts
Este tópico está impedido de receber novos posts.
Entre para seguir isso
Seguidores
0
-
Quem Está Navegando 0 membros estão online
Nenhum usuário registrado visualizando esta página.
Estou tendo dificuldades para entender um código de talkaction, e gostaria que alguém, se possível, me explicasse este código:
create_item.lua:
function onSay(player, words, param) if not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GOD then return false end local split = param:split(",") local itemType = ItemType(split[1]) if itemType:getId() == 0 then itemType = ItemType(tonumber(split[1])) if itemType:getId() == 0 then player:sendCancelMessage("There is no item with that id or name.") return false end end local count = tonumber(split[2]) if count ~= nil then if itemType:isStackable() then count = math.min(10000, math.max(1, count)) elseif not itemType:hasSubType() then count = math.min(100, math.max(1, count)) else count = math.max(1, count) end else count = 1 end local result = player:addItem(itemType:getId(), count) if result ~= nil then if not itemType:isStackable() then if type(result) == "table" then for _, item in ipairs(result) do item:decay() end else result:decay() end end player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) end return false end
talkactions.xml:
Não estou conseguindo entendê-lo para poder criar itens dentro do meu servidor, a partir de um personagem GOD/GM
Comandos que já tentei:
/i boots of haste
/i 2195
/i 2195, 1
/i 2195 1
/i 1 2195
/i 1, 2195
Editado por SchuambachCompartilhar este post
Link para o post
Compartilhar em outros sites