• 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!

Lua How do i fix this script?

snacky

New Member
Joined
Apr 16, 2009
Messages
126
Reaction score
1
EDIT Using TFS 4.0 (8.60 engine)

Hello, otlanders, can someone help me on this please:

I know its a stupid problem, but my skills doesnt help me that much.

This scripts work with a Teleport, if nobody is on the room, you may enter the teleport, then it should summon a Monster, in a previously set location, and teleport your character to that location. (It works ATM, but, once stepped on the teleport, i get several errors of "Tile Not Found".

It does teleports me, but i know something is wrong on it. I really appreaciate your help


ERRORS:

Error - MoveEvents Interface
data/movements/scripts/portal.lua:eek:nStepIn
Description:
<luaGetThingFromPos> Tile not found

Error - MoveEvents Interface
data/movements/scripts/portal.lua:eek:nStepIn
Description:
<luaGetThingFromPos> Tile not found

The code:
Code:
function onStepIn(cid, item, frompos, item2, topos)
    local room = { -- room with Tide
    fromX = 31946,
    fromY = 32870,
    fromZ = 1,
    toX = 31968,
    toY = 32889,
    toZ = 1}
local monster_pos = {
[1] = {pos = {x=31958, y=32883, z=1}}
}
    local player_pos = {x=31954, y=32876, z=1}
    local cansel_pos = {x=31864, y=32890, z=1}
local monster = "Venom"
local storageid = 64001
if item.actionid == storageid then
killedhide = getPlayerStorageValue(cid,storageid)
if killedhide == -1 then
local monster_room = false
local monsters = {}
local i = 1
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z, stackpos = 253}
local thing = getThingfromPos(pos)
if isPlayer(thing.uid) then
doPlayerSendTextMessage(cid,19,"There is already some one in the quest room.")
return true
elseif isMonster(thing.uid) then
monsters = getThingfromPos({x=x, y=y, z=z, stackpos=253})
i = i+1
monster_room = true
end
end
end
end
if monster_room then
for r = 1, #monsters do
doRemoveCreature(monsters[r].uid)
end
end
for _, area in pairs(monster_pos) do
doSummonCreature(monster,{x=31958, y=32883, z=1})
--setPlayerStorageValue(cid,storageid,1)
end
doTeleportThing(cid, player_pos)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have already done this quest.")
doTeleportThing(cid, cansel_pos)
end
end
return true
end
 
Last edited:
Back
Top