Use this function to check whether a position is valid or not.
TFS 0.3+ put in data/lib/functions.lua
TFS 0.2 or other put in data/global.lua
TFS 0.3+ put in data/lib/functions.lua
TFS 0.2 or other put in data/global.lua
Code:
do
-- Function by Colandus!
local validPositionKeys = {"x", "y", "z", "stackpos"}
function isPosition(pos)
local keyAmount = 0
if (type(pos) == "table") then
for key, val in pairs(pos) do
if isInTable(validPositionKeys, key) == FALSE or isNumber(val) == FALSE then
return FALSE
end
keyAmount = keyAmount + 1
end
if (keyAmount ~= 3 and keyAmount ~= 4) then
return FALSE
end
return TRUE
end
return FALSE
end
end