function onStepIn(cid, item, topos, frompos)
if getPlayerPremiumDays(cid) == 0 then
local n = {x = topos.x + 3, y = topos.y, z = topos.z}
doRelocate(topos, n)
doSendMagicEffect(n, 12)
end
return true
end
function onAddItem(item, tile, position)
local n = {x = topos.x + 3, y = topos.y, z = topos.z}
return doRelocate(position, n), doSendMagicEffect(n, 12)
end
function onStepIn(cid, item, pos)
local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)
if isPremium(cid) then
doTransformItem(item.uid, 447)
else
doTeleportThing(cid, niema)
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
end
end
function onStepOut(cid, item, pos)
if item.itemid == 425 then
doTransformItem(item.uid, 446)
end
end
<movevent type="StepIn" uniqueid="8800" event="script" value="premium.lua"/>
Guys, I'm having a problem. Only paccs pass on my bridge, but when a creature like a chicken or a cat tries to pass, I get an error in the distro.
premium.lua
Lua:function onStepIn(cid, item, pos) local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku) if isPremium(cid) then doTransformItem(item.uid, 447) else doTeleportThing(cid, niema) doSendMagicEffect(getCreaturePosition(cid), 14) doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.") end end function onStepOut(cid, item, pos) if item.itemid == 425 then doTransformItem(item.uid, 446) end end
movements.xml
XML:<movevent type="StepIn" uniqueid="8800" event="script" value="premium.lua"/>
ERRO:
[17/02/2021 09:41:30] [Error - MoveEvents Interface]
[17/02/2021 09:41:30] data/movements/scripts/premium2.luanStepIn
[17/02/2021 09:41:30] Description:
[17/02/2021 09:41:30] (luaDoPlayerSendTextMessage) Player not found
local failPosition = Position(X, Y, Z)
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
if player:isPremium() then
return true
end
failPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:teleportTo(failPosition)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE , "You need Premium to access.")
return true
end
<movevent event="StepIn" actionid="XXX" script="XXX.lua"/>
I had this errorLua:local failPosition = Position(X, X, X) function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end if player:isPremium() then return true end failPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) player:teleportTo(failPosition) player:sendTextMessage(MESSAGE_EVENT_ADVANCE , "You need Premium to access.") return true end
Code:<movevent event="StepIn" actionid="XXX" script="XXX.lua"/>
I had this error
[17/02/2021 12:01:39] [Error - MoveEvents Interface]
[17/02/2021 12:01:39] data/movements/scripts/premium.lua
[17/02/2021 12:01:39] Description:
[17/02/2021 12:01:39] data/movements/scripts/premium.lua:1: attempt to call global 'Position' (a nil value)
[17/02/2021 12:01:39] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/premium.lua)
Post automatically merged:
Sorry, I gess is not the same tfs. Ive some bizarre erro with your script. Guys, can u help me in Rook?
local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)
function onStepIn(cid, item, pos)
if not isPlayer(cid) or isPremium(cid) then
doTransformItem(item.uid, 447)
else
doTeleportThing(cid, niema)
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
end
end
function onStepOut(cid, item, pos)
if item.itemid == 425 then
doTransformItem(item.uid, 446)
end
end
function onStepIn(cid, item, pos)
if not isPlayer(cid) then
return true
end
local niema = {x=32060, y=32193, z=7} -- mozna pominac i zrobic tak aby teleportowalo gracza pietro nizej (jak most na rooku)
if isPremium(cid) then
doTransformItem(item.uid, 447)
else
doTeleportThing(cid, niema)
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerSendTextMessage(cid,22,"Sorry, you don't have premium account.")
end
end
function onStepOut(cid, item, pos)
if item.itemid == 425 then
doTransformItem(item.uid, 446)
end
end