Jump to content

Help whit a object system


capitanazop

Recommended Posts

AFAIK this only triggers when the player actually jumps onto an element, not just touching it or colliding with it.

That's what he wants... Or maybe he wants an event that is triggered on ever server pulse? There isn't such event and won't be... That's why we have onClientRender. You can add some data to player (setElementData) that says you are touching object, then you can check (getElementData) if he's touching object in both server-side and client-side scripts. But from what I understand he wants to take away players' hp when touch (contact) with object. If you want to make an object be like a "fire ground" that if you walk on it your hp goes down, you should use timers (server-side) or onClientRender (client-side).

Link to comment

I think you can do it with something like that on clientSide using the onClientRender event.

  
 local sphere = createColSphere( posX, posY, posZ, radius ) 
 local closePlayers = getElementsWithinColShape( sphere, "player" ) 
  

The sphere should be the collision area of the damaging object, and the closePlayers are the players currently hitting it.

Link to comment
I think you can do it with something like that on clientSide using the onClientRender event.
  
 local sphere = createColSphere( posX, posY, posZ, radius ) 
 local closePlayers = getElementsWithinColShape( sphere, "player" ) 
  

The sphere should be the collision area of the damaging object, and the closePlayers are the players currently hitting it.

Not exactly a good idea, because if players stay in the colshape, they'd keep being raped. :P

Better to use an event.

Link to comment

Create an account or sign in to comment

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...