Ir para conteúdo

Featured Replies

Postado

Boa tarde nobre sayajin.

 

Ainda sigo com erro.

Assim que dei use no item pra abrir o portal, deu este erro:

image.thumb.png.533ddfe0bb658b6f27ab61222f9b293d.png

 

Alguns segundos depois, acredito que após os 30 segundos para o portal sumir, deu este erro também e o portal não sumiu.

image.thumb.png.30786ab4fc6680c70100680f3b5f9bc0.png

 

Obrigado por toda ajuda!

  • Respostas 26
  • Visualizações 4.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
-- Town Portal Scroll System based in Dota 2

local config = {
	portalId = 11796,		-- change to portal item id
	portalTime = 30,		-- portal duration in seconds
	scrollId = 14324,		-- change to scroll item id
	effect = CONST_ME_POFF	-- effect id or CONST that appears at the end of time
}

local function checkPortal(uid, pos)
    local position = Position(pos)
	if position then
		local tile = Tile(position)
		if tile then
		local item = tile:getItemById(config.portalId)
		if item then
			item:remove()
			item:getPosition():sendMagicEffect(config.effect)
		else
			local playerId = Player(uid)
			if playerId then
				local portal = Game.createItem(config.portalId, 1, position)
				if portal then
					if playerId:getParty() then
						portal:setCustomAttribute("party", playerId:getParty())
					else
						portal:setCustomAttribute("owner", playerId:getName())
					end
				end
				addEvent(checkPortal, config.portalTime * 1000, uid, pos)
			end
		end
	end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		checkPortal(player:getGuid(), player:getPosition())
	else
		if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
			local itemParty = item:getCustomAttribute("party")
			local itemName = item:getCustomAttribute("name")
			if itemParty then
				if player:getParty() == itemParty or then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You do not participate in the portal creator's party.")
				end
			elseif itemName then
				if player:getName() == itemName then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You isn't the owner.")
				end
			else
				player:popupFYI("You isn't the owner.")
			end
		else
			player:popupFYI("You are PZ locked or in battle.")
		end
	end
	return true
end

 

Postado
-- Town Portal Scroll System based in Dota 2

local config = {
	portalId = 11796,		-- change to portal item id
	portalTime = 30,		-- portal duration in seconds
	scrollId = 14324,		-- change to scroll item id
	effect = CONST_ME_POFF	-- effect id or CONST that appears at the end of time
}

local function checkPortal(uid, pos)
    local position = Position(pos)
	if position then
		local tile = Tile(position)
		if tile then
		local item = tile:getItemById(config.portalId)
		if item then
			item:remove()
			item:getPosition():sendMagicEffect(config.effect)
		else
			local playerId = Player(uid)
			if playerId then
				local portal = Game.createItem(config.portalId, 1, position)
				if portal then
					if playerId:getParty() then
						portal:setCustomAttribute("party", playerId:getParty())
					else
						portal:setCustomAttribute("owner", playerId:getName())
					end
				end
				addEvent(checkPortal, config.portalTime * 1000, uid, pos)
			end
		end
	end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item:getId() == config.scrollId then
		checkPortal(player:getGuid(), player:getPosition())
	else
		if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
			local itemParty = item:getCustomAttribute("party")
			local itemName = item:getCustomAttribute("name")
			if itemParty then
				if player:getParty() == itemParty then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You do not participate in the portal creator's party.")
				end
			elseif itemName then
				if player:getName() == itemName then
					player:teleportTo(player:getTown():getTemplePosition(), true)
				else
					player:popupFYI("You isn't the owner.")
				end
			else
				player:popupFYI("You isn't the owner.")
			end
		else
			player:popupFYI("You are PZ locked or in battle.")
		end
	end
	return true
end

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo