update zones documentation

This commit is contained in:
Luke committed 2022-09-17 13:38:21 +02:00
1 parent 6c2ab8f8ec
commit c42193a9e2
2 files changed
+25 -2

No files matched your search

+24 -1
View File
@@ -1,4 +1,6 @@
An alternative to PolyZone utilising [glm.polygon](https://github.com/gottfriedleibniz/lua/blob/luaglm/EXTENDED.md#polygon).
Faster alternative to PolyZone utilising [glm.polygon](https://github.com/gottfriedleibniz/lua/blob/luaglm/EXTENDED.md#polygon).
## lib.zones.poly
```lua
lib.zones.poly(data)
@@ -8,8 +10,13 @@ lib.zones.poly(data)
* All z values must match
* thickness?: `number`
* Default: `4`
* onEnter: `function`(self: `table`)
* onExit: `function`(self: `table`)
* inside: `function`(self: `table`)
* debug?: `boolean`
## lib.zones.box
```lua
lib.zones.box(data)
```
@@ -19,8 +26,12 @@ lib.zones.box(data)
* Default: `vec3(4, 4, 4)`
* rotation?: `number`
* Angle in degrees
* onEnter: `function`(self: `table`)
* onExit: `function`(self: `table`)
* inside: `function`(self: `table`)
* debug?: `boolean`
## lib.zones.sphere
```lua
lib.zones.sphere(data)
@@ -29,8 +40,13 @@ lib.zones.sphere(data)
* coords: `vector3`
* radius?: `number`
* Default: `2`
* onEnter: `function`(self: `table`)
* onExit: `function`(self: `table`)
* inside: `function`(self: `table`)
* debug?: `boolean`
## Usage Examples
```lua
function onEnter(self)
print('entered zone', self.id)
@@ -92,3 +108,10 @@ poly:remove()
sphere:remove()
box:remove()
```
## Zone creation script
Similarly to PolyZone, there is a zone creation script included.
To use it use the `/zone` with `poly`, `box` or `sphere` as args.
Available controls will be displayed on the right side.
+1 -1
View File
@@ -44,7 +44,7 @@ You can either import the whole library object which contains all the functions
you can deconstruct it and import the functions you find needed at the time.
```ts
import lib from '@overextended/ox_lib/client'
import lib from '@overextended/ox_lib/server'
```
```ts