This function will create a position and check if it's valid or not. You don't need this x=, y=, z=, stackpos=
TFS 0.3+ put in data/lib/functions.lua
TFS 0.2 or other put in data/global.lua
Usage:
TFS 0.3+ put in data/lib/functions.lua
TFS 0.2 or other put in data/global.lua
Code:
function Position(x, y, z, stackpos)
if tonumber(x..y..z) then
local pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)}
if tonumber(stackpos)then
pos.stackpos = tonumber(stackpos)
end
return pos
end
return LUA_ERROR
end
Usage:
Code:
local pos = Position(143, 543, 324) -- Add ", 1" for stackpos 1 or w/e stackpos u want
Last edited: