Scripts / MaxHealth

Author
Message
DragonSK14
9
Years of Service
User Offline
Joined: 3rd Sep 2015
Location:
Posted: 8th Sep 2015 02:05
is there a way to change MaxHealth dynamically through lua instead of statically. I've used SetPlayerHealth which does nothing towards MaxHealth
PM
Northern
14
Years of Service
User Offline
Joined: 5th Nov 2010
Location: Brazil
Posted: 8th Sep 2015 07:16
@DragonSK14:

DragonSK14 wrote:

Quote: "is there a way to change MaxHealth dynamically through lua instead of statically. I've used SetPlayerHealth which does nothing towards MaxHealth"


Hi,

The easiest way to get what you want, is to use collectible objects or entities, such as MedBox or Medical Cross (see it in cartoon assets), which you may spread out them within your game level.

The hard way is writing a Lua script file. Below, you have a link to download a Lua script I wrote, called 'myhealingzone.lua', which, perhaps, it might help you. It has worked fine with the latest release of the GG (1.01.0034); that I have installed on my PC system.

https://www.dropbox.com/s/u9b9zv9ainstmgh/myhealingzone.lua?dl=0

I have set the max health value to 1000 units; however, if you prefer greater or lesser values, just adjust it, as needed, in the line 'SetPlayerHealth(1000);'

Please note, the 'myhealingzone.lua' file should be used with a trigger zone , within your game scenario.

Have fun!
Northern
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Sep 2015 13:36
i dont think so, maybe create your own hud and store a variable that updates your own "max hp" as right now the first value is the only 1 that changes
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Northern
14
Years of Service
User Offline
Joined: 5th Nov 2010
Location: Brazil
Posted: 9th Sep 2015 06:31
Smallg wrote:

Quote: "i dont think so, ..."


Hello,

I am sorry, but what do you mean by "I don't think so ..." ? I did not understand your statement!

Have you found any error (not including English grammar) in my previous post?

Greetings,
Northern
PM

Login to post a reply

Server time is: 2024-12-22 05:37:52
Your offset time is: 2024-12-22 05:37:52