Jump to content

NPCs: "immortal peds"


Recommended Posts

Posted

Presuming you have a ped defined as "ped", the script below should work (client-side):

function invPed()
cancelEvent()
end
addEventHandler("onClientPedDamage",ped,invPed)

Posted
Presuming you have a ped defined as "ped", the script below should work (client-side):
function invPed()
cancelEvent()
end
addEventHandler("onClientPedDamage",ped,invPed)

it work?

Posted
Dont work :oops:

If I shoot in one ped, just appears different. all. This happens once. please help to create invincible npc :roll:

You know you should put that client side, not server side.

Posted
This means that you need to specify a meta "client"? Or should he put his life in a folder "mods"?

I don't really know, what you want to say with this, but you need to put the script snippet into a script file, which itself is added with a 'type="client"'.

So let's say that your file is called client.lua. Then your meta.xml line would look like this:

<script src="client.lua" type="client" />

Here is another help for it:

https://wiki.multitheftauto.com/wiki/Client_side_scripts

  • 6 months later...
Posted

try this code

--the Ped-- 
local noobPed = createPed(278, 0, 0, 0, 0) 
setElementRotation(noobPed, ZRotation) 
  
  
--every 100 miliseconds the ped health will be set to 100-- 
function hp() 
setElementHealth(noobPed, 100) 
end 
setTimer, 100, 0) 

Posted
try this code
--the Ped-- 
local noobPed = createPed(278, 0, 0, 0, 0) 
setElementRotation(noobPed, ZRotation) 
  
  
--every 100 miliseconds the ped health will be set to 100-- 
function hp() 
setElementHealth(noobPed, 100) 
end 
setTimer, 100, 0) 

That uses too much CPU. Actually, Callum said how to do this.

  • 2 months later...
Posted

If he is trying to give some help addition to the topic, isn't bad to bump it.

Oh, and for to make invincible peds, use my simple script resource, Extra Health. It's at my signature, check:

|

|

|

V

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