Lua:
local config = {
[9990] = Position(989, 1042, 7),
[9991] = Position(989, 1042, 7)
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local targetPosition = config[item.uid]
if not targetPosition then
return true
end
local chance = 50
if math.random(1, 100) <= chance then
player:teleportTo(targetPosition)
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -150, -150, CONST_ME_NONE)
targetPosition:sendMagicEffect(CONST_ME_WATERSPLASH)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, '')
return true
else
player:sendCancelMessage('')
end
end
XML:
<movement event="StepIn" fromuid="9990" touid="9991" script="custom/port.lua"/>
When I get on the server to test, it doesn't work. No errors in console. Unique ids are present on the map. No duplicate uniqueids. Just doesn't work.
TFS 1.3
Enlighten me please