Jump to content

Invincible when entering a Colshape


Recommended Posts

Anyone knows how to make the player Invincible/godmode when entering a Colshape?

my code looks like this:

let someColShape = mp.colshapes.newRectangle(-1350, -1435, 10.7, 100);

function playerEnterColshapeHandler(player, shape) {
  if(shape == someColShape) {
	player.health = 100
	player.removeWeapon(736523883); // SMG
	player.removeWeapon(453432689); // PISTOL

mp.events.add("playerEnterColshape", playerEnterColshapeHandler);



Link to comment
Share on other sites

Remembering that the playerEnterColshape event is not a loop, that is, you only call set health 100 once, so he will only leave the player with 100 life when he enters the shape, and then he can suffer damage. Use setInvincible that Xabi has commented on, or you can loop in your player.health, which would not be cool.

Remembering that a correct area for your post would be here https://rage.mp/forums/forum/44-discussion/

Edited by LeozinH1
Link to comment
Share on other sites

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...