Jump to content

Colshape Handler 1.0.0

   (0 reviews)

About This File

Simple CommonJS singleton module to handle colshape entering and exiting.

Copy the Colshapes folder inside packages inside your packages folder. See the Examples folder for an example.

Simply create your colshape like this:

const colshape = mp.colshapes.newSphere(34, 15, 69, 15, 0)
colshape.name = 'example'

and then pull in the colshapeHandler singleton to add it to the array the following:

const colshapeHandler = require('../Colshapes/index').getInstance()
colshapeHandler.addColshape('example')

If a player enters the specified colshape, the colshape name will be pushed towards a colshapes array as a player property, like this. Definition of this is inside the "playerJoin" event in the Colshapes\index.js. The specified colshape name will then be removed from the array again if the player exits the colshape.
 

player.colshapes = [];

 


User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

There are no reviews to display.

×
×
  • Create New...