29 lines
No EOL
778 B
Lua
29 lines
No EOL
778 B
Lua
local api = {}
|
|
|
|
local function xzbounds(num)
|
|
return num > -10001 and num < 10001
|
|
end
|
|
|
|
local function ybounds(num)
|
|
return num > -65 and num < 321
|
|
end
|
|
|
|
api.checkBounds = function(x, y, z)
|
|
x, y, z = tonumber(x), tonumber(y), tonumber(z)
|
|
if not x then
|
|
return false, "Value x is not a number."
|
|
elseif not y then
|
|
return false, "Value y is not a number."
|
|
elseif not z then
|
|
return false, "Value z is not a number."
|
|
elseif not xzbounds(x) then
|
|
return false, "Value x = "..x.." is out of bounds."
|
|
elseif not ybounds(y) then
|
|
return false, "Value y = "..y.." is out of bounds."
|
|
elseif not xzbounds(z) then
|
|
return false, "Value z = "..z.." is out of bounds."
|
|
end
|
|
return true, x, y, z
|
|
end
|
|
|
|
return api |