Scripts / [SOLVED] Unkillable enemies

Author
Message
gaku95
3
Years of Service
User Offline
Joined: 2nd Dec 2020
Location: Buenos Aires, Argentina
Posted: 3rd Dec 2020 16:31
Hi, im new to this software and im trying to desing a level where most common soldiers can be killed but some of them can not. Im trying using this script:



For the soldiers that are unkillable i use "SetEntityHelath(e,10000)" so they wont die when they get headshot.

So far i can make a level where all enemies are unkillable OR a level where all enemies can be killed. But i cant combine them.
Can someone help me with this? PLEASE

The author of this post has marked a post as an answer.

Go to answer
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 3rd Dec 2020 18:11
This post has been marked by the post author as the answer.
you can't have 2 functions named the same which is why only 1 of them will work.
so either change the name and the name when it is called or add a variable that toggles between the 2.
i.e. (just checks if current health is above 500 for unkillable enemies)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
gaku95
3
Years of Service
User Offline
Joined: 2nd Dec 2020
Location: Buenos Aires, Argentina
Posted: 3rd Dec 2020 20:50
smallg you are a genius. This is exactly what I was looking for.

Thank you very much!!
PM

Login to post a reply

Server time is: 2024-04-19 08:42:20
Your offset time is: 2024-04-19 08:42:20