Jump to content

How to cancel player damage in a Safe Zone?


xTanKx

Recommended Posts

Well, I'm making my RPG Server, and I want to give players who are in safe zone infinite health.

I tryed to use these lines but don't work

function canceldamage() 
    if (not isElementWithinSafeZone(localPlayer)) then return end 
    if (getElementDimension(localPlayer) ~= 0) then return end 
    cancelEvent() 
end 
addEventHandler("onClientPedDamage", getRootElement(), canceldamage) 

Can you help me to do that?

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