Add more
This commit is contained in:
parent
f7bb6c8137
commit
5769eca2f2
5 changed files with 194 additions and 57 deletions
29
common.lua
Normal file
29
common.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue