From cabfbfb1075e032dc0aa6bba34def805c4b74982 Mon Sep 17 00:00:00 2001 From: DokaDoka Date: Thu, 12 May 2022 15:58:27 +1000 Subject: [PATCH] add zone docs --- docs/ox_lib/Client/zones.md | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/ox_lib/Client/zones.md diff --git a/docs/ox_lib/Client/zones.md b/docs/ox_lib/Client/zones.md new file mode 100644 index 00000000..e42ce075 --- /dev/null +++ b/docs/ox_lib/Client/zones.md @@ -0,0 +1,41 @@ +# Zones + +More optimised version of polyzones utilising glm polygon. + +```lua +-- data: table + -- points: table of vector3s, all z values must match + -- thickness: number (optional), default 2 + -- debug: bool (optional) +lib.zones.poly(data) + +-- data: table + -- coords: vector3 + -- size: vector3 + -- rotation: number (optional), angle in degrees + -- debug: bool (optional) +lib.zones.box(data) + +-- data: table + -- coords: vector3 + -- radius: number (optional), default is 2 + -- debug: bool (optional) +lib.zones.sphere(data) + +local zone = lib.points.box({ + coords = playerCoords, + dunak = 'nerd', +}) + +function zone:onEnter() + print('entered box', self.id) +end + +function zone:onExit() + print('exited box', self.id) +end + +function zone:inside() + print('you are inside the box ' .. self.id) +end +```