health?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
XenoPHoXx_NL
Sergeant
Posts: 53
Joined: Thu Feb 16, 2006 11:26 pm
Contact:

health?

Post by XenoPHoXx_NL »

hi guys a little question if i may do it



Im trying to make a script for healing the player.

When for exc. you walk in a mp game and you got less health like 12%
is it possible by makeing a script and bind a key to it to receive some health for the player?
Can't Win The Game? Change The Rules!
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

trigger

Post by tltrude »

Well, it would be easier to just create a trigger. The player would only have to walk up to a health station and touch something or press his "use" key to be healed. Below is a thread I used in the map named Murders_row.

Image

Code: Select all

gold_rocket:

	local.rocket = spawn script_model model "static/gold_v2.tik"
	local.rocket.origin = ( 736 544 80 )
	local.rocket.scale = .2
	local.rocket notsolid

	local.rocketclip = spawn script_object
	local.rocketclip.origin = local.rocket.origin
	local.rocketclip setsize ( -16 -16 0 ) ( 16 16 128 )
	local.rocketclip solid

	local.rc = spawn script_model model "static/corona_orange.tik"
	local.rc.origin = ( 736 544 235 )
	local.rc.scale = .6

	local.rocket_trigger = spawn trigger_multiple targetname "health_trigger"
	local.rocket_trigger.origin = local.rocket.origin
	local.rocket_trigger setsize ( -18 -18 0 ) ( 18 18 128 )

	health_giver:

	$health_trigger waittill trigger
	local.player = parm.other
	if ((isalive local.player) && (local.player.health < 100))
		{
		local.player heal 1
		local.player playsound med_kit
		local.player exec global/message_print.scr::message "Health restored!" NIL 4
		}
	wait 4
	goto health_giver

end
The "static/gold_v2.tik" model is a gold textured rocket I created. If you want to use it, it is in the Murders_row pk3, and it is also used in the map named test_pointer.
Last edited by tltrude on Sat Mar 04, 2006 11:29 am, edited 4 times in total.
Tom Trude,

Image
User avatar
XenoPHoXx_NL
Sergeant
Posts: 53
Joined: Thu Feb 16, 2006 11:26 pm
Contact:

Post by XenoPHoXx_NL »

thanks m8 ill try that
but its not what im looking for
any other solutions well i mean i don't want to say it isnt nice done
but i only want to make it by binding a key to it

is this possible? and if yes how

thx for you're help anyway
Can't Win The Game? Change The Rules!
Post Reply