PS

Comando /i não funciona

Por PsyMcKenzie, 11 de abr. de 2016 em Scripts

3
1.2k
PsyMcKenzieP
11 de abril de 2016 às 21:49

Alguém sabe o que pode ser?
Não funciona, não da erro e não acontece nada! '-'

Uso TFS 1.2 - 10.90

Script:

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:isFluidContainer()  then			count = math.min(100, math.max(1, count))		else			count = math.max(0, count)		end	else		count = itemType:isFluidContainer() and 0 or 1	end	local result = player:addItem(itemType:getId(), count)	if result ~= nil then		if not itemType:isStackable() then			if type(result) == "table" then				for i = 1, #result do					result[i]:decay()				end			else				result:decay()			end		end		player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)	end	return falseend

 

Editado Abril 11 por PsyMcKenzie

SirarckenS
11 de abril de 2016 às 22:19

Testa esse..

Spoiler
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:isFluidContainer()  then			count = math.min(100, math.max(1, count))		else			count = math.max(0, count)		end	else		count = itemType:isFluidContainer() and 0 or 1	end	local result = player:addItem(itemType:getId(), count)	if result ~= nil then		if not itemType:isStackable() then			if type(result) == "table" then				for i = 1, #result do					result[i]:decay()				end			else				result:decay()			end		end		player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)	end	return falseend

 

 

Parece igual ao seu...

qual o id do item que ta tentando criar?

Editado Abril 11 por Sirarcken

PsyMcKenzieP
11 de abril de 2016 às 23:00
39 minutos atrás, Sirarcken disse:

Testa esse..

  Mostrar conteúdo oculto
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:isFluidContainer()  then			count = math.min(100, math.max(1, count))		else			count = math.max(0, count)		end	else		count = itemType:isFluidContainer() and 0 or 1	end	local result = player:addItem(itemType:getId(), count)	if result ~= nil then		if not itemType:isStackable() then			if type(result) == "table" then				for i = 1, #result do					result[i]:decay()				end			else				result:decay()			end		end		player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)	end	return falseend

 

 

Parece igual ao seu...

qual o id do item que ta tentando criar?

 

O erro continua.

E acho que tu me passou o mesmo script.

Eu não consigo fazer nenhum item.