Hey guys
I am currently trying to find errors on the server I am planning on using in the future.
Atm I am using RealOTX 7.72 TFS 1.3 by mattyx14.
Now the problems I've encountered so far is that destroy field or animate dead are not working.
When I am trying to use Destroy field nothing happens and this is the error code i get:
This is my destroyfield.lua
And when I am trying to use animate dead rune, then the dead corpse disappears but there is no skeleton spawning, I recieve this error in my console:
This is my animate dead.lua:
This is my global.lua:
If I failed to express my errors or if there is something more I can add to make it easier for anybody to help just let me know.
Thanks in advance
//Absorc
I am currently trying to find errors on the server I am planning on using in the future.
Atm I am using RealOTX 7.72 TFS 1.3 by mattyx14.
Now the problems I've encountered so far is that destroy field or animate dead are not working.
When I am trying to use Destroy field nothing happens and this is the error code i get:
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/support/destroy_field_rune.lua:onCastSpell
data/spells/scripts/support/destroy_field_rune.lua:3: attempt to call global 'getAllCreatures' (a nil value)
stack traceback:
[C]: in function 'getAllCreatures'
data/spells/scripts/support/destroy_field_rune.lua:3: in function <data/spells/scripts/support/destroy_field_rune.lua:1>
Lua:
function onCastSpell(cid, var)
local position = variantToPosition(var)
local creaturesSize = #getAllCreatures(position)
local stackSize = getTileStackItemsSize(position) + creaturesSize
local itemsTable = {}
local removed = false
if stackSize > 0 then
for i=1,stackSize do
position.stackpos = i
itemsTable[i] = getTileThingByPos(position)
end
end
if #itemsTable > 0 then
for k, item in pairs(itemsTable) do
if isInArray(FIELDS, item.itemid) then
doRemoveItem(item.uid)
removed = true
end
end
end
if removed then
doSendMagicEffect(position, CONST_ME_POFF)
return true
end
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
And when I am trying to use animate dead rune, then the dead corpse disappears but there is no skeleton spawning, I recieve this error in my console:
Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/support/animate_dead_rune.lua:onCastSpell
data/spells/scripts/support/animate_dead_rune.lua:7: attempt to call global 'doPlayerSummonCreature' (a nil value)
stack traceback:
[C]: in function 'doPlayerSummonCreature'
data/spells/scripts/support/animate_dead_rune.lua:7: in function <data/spells/scripts/support/animate_dead_rune.lua:1>
Lua:
local function doTargetCorpse(cid, pos)
local getPos = pos
getPos.stackpos = 255
corpse = getThingfromPos(getPos)
if(corpse.uid > 0 and isCreature(corpse.uid) == false and isInArray(CORPSES, corpse.itemid) ) then
doRemoveItem(corpse.uid)
doPlayerSummonCreature(cid, "Skeleton", pos)
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
return LUA_NO_ERROR
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return LUA_ERROR
end
function onCastSpell(cid, var)
local pos = variantToPosition(var)
if(pos.x ~= 0 and pos.y ~= 0 and pos.z ~= 0) then
return doTargetCorpse(cid, pos)
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return LUA_ERROR
end
Lua:
dofile('data/lib/lib.lua')
NOT_MOVEABLE_ACTION = 8000
PARTY_PROTECTION = 1 -- Set to 0 to disable.
ADVANCED_SECURE_MODE = 1 -- Set to 0 to disable.
STORAGEVALUE_PROMOTION = 30018
ropeSpots = {384, 418}
doors = {[1209] = 1211, [1210] = 1211, [1212] = 1214, [1213] = 1214, [1219] = 1220, [1221] = 1222, [1231] = 1233, [1232] = 1233, [1234] = 1236, [1235] = 1236, [1237] = 1238, [1239] = 1240, [1249] = 1251, [1250] = 1251, [1252] = 1254, [1253] = 1254, [1539] = 1540, [1541] = 1542, [3535] = 3537, [3536] = 3537, [3538] = 3539, [3544] = 3546, [3545] = 3546, [3547] = 3548, [4913] = 4915, [4914] = 4915, [4916] = 4918, [4917] = 4918, [5082] = 5083, [5084] = 5085}
verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083}
horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085}
openSpecialDoors = {1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552}
questDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551}
levelDoors = {1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549}
keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092}
function getDistanceBetween(firstPosition, secondPosition)
local xDif = math.abs(firstPosition.x - secondPosition.x)
local yDif = math.abs(firstPosition.y - secondPosition.y)
local posDif = math.max(xDif, yDif)
if firstPosition.z ~= secondPosition.z then
posDif = posDif + 15
end
return posDif
end
function getFormattedWorldTime()
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
table.contains = function(array, value)
for _, targetColumn in pairs(array) do
if targetColumn == value then
return true
end
end
return false
end
string.split = function(str, sep)
local res = {}
for v in str:gmatch("([^" .. sep .. "]+)") do
res[#res + 1] = v
end
return res
end
string.trim = function(str)
return str:match'^()%s*$' and '' or str:match'^%s*(.*%S)'
end
Thanks in advance
//Absorc
Last edited: