HELDER Posted May 16, 2018 Posted May 16, 2018 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); Thanks
Xabi Posted May 16, 2018 Posted May 16, 2018 You'll have to call this method, being the player the entity: https://wiki.rage.mp/index.php?title=Entity::setInvincible
LeozinH1 Posted May 16, 2018 Posted May 16, 2018 (edited) 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 May 16, 2018 by LeozinH1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now