• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Firewalker Boots Teleport

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Hello,
I have this firewalker boots teleport but there are some problems:
1. If playerA die inside room then Pythius The Rotten will be alive.
2. If playerB try to do after PlayerA died, then there will be 2 monsters.
It's not removing monster before creating another.

Can someone fix or give me a better script?
LUA:
function onStepIn(cid, item, position, fromPosition)

--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 321, y = 823, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->

--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.

if item.actionid == 9022 then
doTeleportThing(cid, player_pos_saida)
doSendMagicEffect(player_pos_saida, 10)
doRemoveItem(portal_iten_pos.uid, 1)
return TRUE
end

if item.actionid == 9021 and queststatus == -1 then
players = 0
totalmonsters = 0
monster = {}
repeat
creature = getThingfromPos(checking)
if creature.itemid > 0 then

if getPlayerAccess(creature.uid) == 0 then
players = players + 1
end

if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
totalmonsters = totalmonsters + 1
monster[totalmonsters] = creature.uid
end
end
checking.x = checking.x + 1

if checking.x > ending.x then
checking.x = starting.x
checking.y = checking.y + 1
end

until checking.y > ending.y

if players == 0 then

if totalmonsters ~= 0 then
current = 0
repeat
current = current + 1
doRemoveCreature(monster[current])
until current >= totalmonsters
end

doTeleportThing(cid, player_pos_entrada)
doSendMagicEffect(player_pos_entrada, 10)
doCreateMonster(boss, boss_pos)

if portal_iten_pos.itemid == teleportId then
doRemoveItem(portal_iten_pos.uid, 1)
end

else
doMoveCreature(cid, newdir)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'is in the room now. Wait a moment!')
end
else
doMoveCreature(cid, newdir)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end
 
Here i did a try idk if it will work!
edit from position toposition.
PHP:
function onStepIn(cid, item, position, fromPosition)
 
--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 321, y = 823, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local fromPosition = {x = xx, y = xx, z = x}, -- top left cornor of the playground
local toPosition = {x = xx, y = xx, z = x}, -- bottom right cornor of the playground
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
doTeleportThing(cid, player_pos_saida)
doSendMagicEffect(player_pos_saida, 10)
doRemoveItem(portal_iten_pos.uid, 1)
return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
players = 0
totalmonsters = 0
monster = {}
repeat
creature = getThingfromPos(checking)
if creature.itemid > 0 then
 
if getPlayerAccess(creature.uid) == 0 then
players = players + 1
end
 
if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
totalmonsters = totalmonsters + 1
monster[totalmonsters] = creature.uid
end
end
checking.x = checking.x + 1
 
if checking.x > ending.x then
checking.x = starting.x
checking.y = checking.y + 1
end
 
until checking.y > ending.y
 
if players == 0 then
 
for x = config.fromPosition.x, config.toPosition.x do
for y = config.fromPosition.y, config.toPosition.y do
for z = config.fromPosition.z, config.toPosition.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end

doTeleportThing(cid, player_pos_entrada)
doSendMagicEffect(player_pos_entrada, 10)
doCreateMonster(boss, boss_pos)
 
if portal_iten_pos.itemid == teleportId then
doRemoveItem(portal_iten_pos.uid, 1)
end
 
else
doMoveCreature(cid, newdir)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'is in the room now. Wait a moment!')
end
else
doMoveCreature(cid, newdir)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end
 
local fromPosition = {x = xx, y = xx, z = x}, -- top left cornor of the playground
local toPosition = {x = xx, y = xx, z = x}, -- bottom right cornor of the playground

same thing of

local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 321, y = 823, z = 15, stackpos = 253}
 
Back
Top