local config = {
storage = 55666, -- storage the same in 2scripts
position = Position(32345, 31801, 7) -- teleport to pos
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local targetPosition = (item.actionid)
if not targetPosition then
return true
end
if player:getStorageValue(config.storage) < 1 then
player:teleportTo(fromPosition)
player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have access to this area.')
return true
end
player:teleportTo(config.position)...
local config = {
storage = 55666, -- storage the same in 2scripts
position = Position(32345, 31801, 7) -- teleport to pos
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local targetPosition = (item.actionid)
if not targetPosition then
return true
end
if player:getStorageValue(config.storage) < 1 then
player:teleportTo(fromPosition)
player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have access to this area.')
return true
end
player:teleportTo(config.position)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
local config = {
storage = 55666 -- storage the same in 2scripts
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local sqmPosition = (item.actionid)
if not sqmPosition then
return true
end
if player:getStorageValue(config.storage) < 1 then
player:setStorageValue(config.storage, 1)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tekst MSG.') -- you can use another msg function
end
return true
end
<movevent event="StepIn" actionid="your tp actionID" script="script name tp.lua" />
<movevent event="StepIn" actionid="your sqm actionID" script="script name sqm.lua" />