.Qual servidor ou website você utiliza como base? client 13+
Qual o motivo deste tópico? não estou conseguindo fazer com que o script faça a verificação do iten no inventario
Está surgindo algum erro? Se sim coloque-o aqui.
Você tem o código disponível? Se tiver publique-o aqui:
local teleports = {
{ teleportPosition = { x = 32399, y = 32202, z = 7 }, teleportDestination = Position(32395, 32194, 7)},
{ teleportPosition = { x = 32400, y = 32202, z = 7 }, teleportDestination = Position(32395, 32194, 7)}
}
local TI_TITANIUM_TOKEN = 28493
local arena = MoveEvent()
function playerHasTitaniumToken(player)
if not player then
return false
end
local inventory = player:getInventory()
if not inventory then
return false
end
for _, item in ipairs(inventory:getItems()) do
if item:getId() == TI_TITANIUM_TOKEN then
return true
end
end
return false
end
function arena.onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
if playerHasTitaniumToken(player) then
local playerPosition = player:getPosition()
for _, teleport in ipairs(teleports) do
local teleportPos = Position(teleport.teleportPosition)
if playerPosition == teleportPos then
player:teleportTo(teleport.teleportDestination)
return true
end
end
else
player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você precisa do Titanium Token para acessar este teleport.")
end
return true
end
for _, teleport in ipairs(teleports) do
arena:position(Position(teleport.teleportPosition))
end
arena:register()
Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.