UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Player Health (Buyable Food)

broken avatar :(
Created 3 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
486 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Howdy,

Here i have created a Player Heath Script. It has 'Nothing' to do with 'engine' health. Meaning that being hit by a zombie or taking any kind of damage for that matter will not affect this scripted health.

I've set it up so Full Health lasts for 30 minutes. If playing Solo mode & you have the Quick Revive perk then you'll go into last stand when this health hits 0. If you don't have quick revive then Game Over. However if playing in Co Op mode then when your health hits 0 you will Always goes into laststand.
In both modes once you go down(into laststand) you get 30 seconds of health before going down again unless of course you buy food.

On-screen displayed health(bottom left goes down by 5 at a time, until you hit 5 health, in which it'll then go down by 1 at a time.
1 health == 18 seconds.
5 health == 90 seconds.
100 health == 30 minutes.

CREDITS:
HitmanVere - i guess because i'm using the same approach that he helped me with on the power generator script i released.
"some dude on ugx" - who posted a topic about using a hud to display engine(player health). Ive since deleted that bookmark so i dont know his name but i am essentially using the same example he provided in his tut.
& of course the "gang":
JohnDoe
Numan
Dr. Dronken
 - for all their help along the way. :)

Link to the _player_health.gsc file
https://mega.nz/file/BkJxTK7I#eGb1VN3xzzu5eNHgt3YvmrlOZnzp1V7u9-_sL3yz3hA

End result video:
https://www.youtube.com/watch?v=W9GmJceX3kA&ab_channel=PhilGibson
NOTE: The messages in the middle of the screen & the top left are for testing purposes & of course to speed up the video by purposely reducing health quicker.

Installation:
Code Snippet
Plaintext
in your mapname.gsc i.e root>mods>mapname>maps>mapname.gsc file [mapname means Your Map Name].

add-
maps\_player_health::init();

under-
maps\_zombiemode::main();

Then-

Download the _player_health.gsc file and place it in root>mods>mapname>maps folder
Open radiant and make a trigger_use brush. Give it a kvp of:
targetname
buy_food_trig
This will be where you buy food from(obv). aha

Tick the _player_health box in the 'IWD File List' on the build mod tab(launcher) & you should be good to go.
Hope you enjoy it!
Phil

 
Loading ...