Postado Novembro 16, 2020 4 anos function onSay(player, words, param) if param == "" then player:sendCancelMessage("Invalid parameter.") return false elseif not tonumber(param) then player:sendCancelMessage("Invalid parameter. Parameter must be a number.") return false end local id = param local item = ItemType(id) if item then for _, c in pairs(Game.getPlayers()) do if c then c:addItem(id, 1) c:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received a " .. ItemType(id):getName() .. ".") end end else player:sendCancelMessage("Item with this id does not exist.") return false end return false end tenta assim mas assim qualquer um pode usar
Postado Novembro 16, 2020 4 anos function onSay(player, words, param) if player:getGroup():getId() < 3 then return false end local split = param:splitTrimmed(",") if not split[1] then player:sendCancelMessage("Necessita de pelo menos um parametro") return false end local item = tonumber(split[1]) and ItemType(tonumber(split[1])) or ItemType(split[1]) local itemid = item:getId() count = 1 if split[2] then count = tonumber(split[2]) > 0 and tonumber(split[2]) or 1 end if itemid > 0 then for _, pid in pairs(Game.getPlayers()) do if pid:addItem(itemid, count, false) then pid:sendTextMessage(22, "Você ganhou " ..count.. "x " ..item:getName().. ".") end end return true end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item invalido!") return false end <talkaction words="!additem" separator=" " script="additem.lua" /> Pode usa com nome do item ou id, com parametro de quantidade e se tiver sem vai entregar só 1 !additem gold coin, 99 Se nao estiver funcionando vc precisa ver se o char q está testando está configurado certo para usar os comandos, pois o do worthdavi deveria está funcionando tbm. Ve algum comando que usa ja e muda o começo que verifica se é da staff Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Postado Novembro 16, 2020 4 anos Autor 9 minutos atrás, worthdavi disse: function onSay(player, words, param) if param == "" then player:sendCancelMessage("Invalid parameter.") return false elseif not tonumber(param) then player:sendCancelMessage("Invalid parameter. Parameter must be a number.") return false end local id = param local item = ItemType(id) if item then for _, c in pairs(Game.getPlayers()) do if c then c:addItem(id, 1) c:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received a " .. ItemType(id):getName() .. ".") end end else player:sendCancelMessage("Item with this id does not exist.") return false end return false end tenta assim mas assim qualquer um pode usar aparece isso "You received a ." mas não recebo nenhum item. 2 minutos atrás, Naze disse: 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:splitTrimmed(",") if not split[1] then player:sendCancelMessage("Necessida de pelo menos um parametro") return false end local item = tonumber(split[1]) and ItemType(tonumber(split[1])) or ItemType(split[1]) local itemid = item:getId() count = 1 if split[2] then count = tonumber(split[2]) > 0 and tonumber(split[2]) or 1 end print(split[2]) if itemid > 0 then for _, pid in pairs(Game.getPlayers()) do if pid:addItem(itemid, count, false) then pid:sendTextMessage(22, "Você ganhou " ..count.. "x " ..item:getName().. ".") end end return true end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Item invalido!") end <talkaction words="!additem" separator=" " script="additem.lua" /> Pode usa com nome do item ou id, com parametro de quantidade e se tiver sem vai entregar só 1 !additem gold coin, 99 fiz tudo certinho e não aconteceu nada, será que falta algo na source?
Postado Novembro 16, 2020 4 anos nao, como falei a conta que esta testando deve nao ter acesso Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.