• 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 TFS 1.0 script errors

rodrilois

New Member
Joined
Jun 9, 2009
Messages
94
Reaction score
0
Hello friends I have a problem in the script, see if you can help me

n471.jpg


script:

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(item.actionid == 104) then
doPlayerTeleportIfStorage(cid, STORAGE_DRAGON, 2, {x = 33028, y = 31085, z = 13}, lastPosition)
elseif(item.actionid == 205) then
doPlayerTeleportIfStorage(cid, STORAGE_ZIZZLE, 1, {x = 33240, y = 31246, z = 10}, lastPosition)
elseif(item.actionid == 205) then
doPlayerTeleportIfStorage(cid, STORAGE_DRAGON, 2, {x = 33028, y = 31085, z = 13}, lastPosition)
elseif(item.actionid == 125) then
doPlayerTeleportIfStorage(cid, STORAGE_END, 2, {x = 33361, y = 31397, z = 9}, lastPosition)
elseif(item.actionid == 112) then
addEvent(doPlayerTeleportIfStorage, 1000, cid, STORAGE_BOSS, 4, {x = 33054, y = 31167, z = 14})
elseif(item.actionid == 135) then
doPlayerTeleportIfStorage(cid, STORAGE_END, 2, {x = 33093, y = 31122, z = 12}, lastPosition)
elseif(item.actionid == 136) then
if(getPlayerItemCount(cid, 12629) >= 1) then
doPlayerRemoveItem(cid, 12629, 1)
doPlayerTeleportIfStorage(cid, STORAGE_END, 2, {x = 33084, y = 31214, z = 8}, lastPosition)
else
doTeleportThing(cid, fromPosition)
end
end
return true
end

- - - Updated - - -

lt7i.jpg


- - - Updated - - -

Hello friends, I have a problem on my server, I'm using TFS 1.0, I migrated my overall this version can not open the market, anyone know how to solve?

- - - Updated - - -

Erro in arenaroon.lua
getstorage

local monster_uid = type(getStorage(arena_room+100)) == 'string' and 0 or getStorage(arena_room+100)
 
Last edited:
pos.y = pos.y + n
pos.x = pos.x - n
elseif(direction == SOUTHEAST) then
pos.y = pos.y + n
pos.x = pos.x + n
end

return pos
end

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
local creature = getTopCreature({x = position.x + x, y = position.y + y, z = position.z})
if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
table.insert(creaturesList, creature.uid)
end
end
end
end

local creature = getTopCreature(position)
if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and not (showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end

function addContainerWithItems(cid, container, item, item_count, count)
local Container = doPlayerAddItem(cid, container, 1)
for i = 1, count do
doAddContainerItem(Container, item, item_count)
end
end

function tableToPos(t)
if type(t) == "table" and #t == 3 and tonumber(table.concat(t)) then
return {x = tonumber(t[1]), y = tonumber(t[2]), z = tonumber(t[3])}
end
return FALSE
end

function getCount(string)
local b, e = string:find("%d+")
return b and e and tonumber(string:sub(b, e)) or -1
end

-- Returns player name if player exists in database or empty string
function playerExists(name)
local resultId = db.storeQuery("SELECT `name` FROM `players` WHERE `name` = " .. db.escapeString(name))
if resultId == false then
return ""
end

local playerName = result.getDataString(resultId, "name")
result.free(resultId)
return playerName
end

-- Updates bank account balance of an offline player
function transferGold(player, amount)
db.query("UPDATE `players` SET `balance` = `balance` + " .. amount .. " WHERE `name` = " .. db.escapeString(player))
return true
end


function getTibianTime()
local worldTime = getWorldTime()
local hours = math.floor(worldTime / 60)

local minutes = worldTime % 60
if minutes < 10 then
minutes = '0' .. minutes
end
return hours .. ':' .. minutes
end
 
Back
Top