Healing Players... How?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Healing Players... How?

Post by Logan MTM »

Hi everyone!

Code: Select all

Script 700 ENTER
{
Delay(35); 
If (CheckInventory("Health") > 0)
 {
 GiveInventory("Health",1);
 }
 Restart;
}
The code above work fine in SP mode, how to make it work in MultiPlayer? ^^'

I meant, heal all players in game.
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Healing Players... How?

Post by Remmirath »

Try with NET ENTER.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Healing Players... How?

Post by Xaser »

Actually, the 'net' keyword would come after ENTER, and all it does is flag scripts as "pukable" and really isn't useful unless it's set up as an alias in KEYCONF. Not the case here.

Ideally, as an ENTER script, shouldn't this work as-is? A copy of it is executed for each player on the map, so I'd imagine that each player would have their own cycling health script. Not sure what the issue is here.

Otherwise you can use an ENTER script to assign players TIDs (using [wiki]playernumber[/wiki]), then have a looping OPEN script that uses HealThing on them.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Healing Players... How?

Post by edward850 »

use HealThing(1); instead. (1 being the value of how much health to give.)
You may want to add a respawn script for when a player... respawns.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: Healing Players... How?

Post by Macil »

That script should already work as it is. Nothing needs changing.

(Making it a ENTER NET script would be incorrect because then players could start the script multiple times for themself, and make their health charge faster.)
(You don't need a RESPAWN script because ENTER scripts do NOT stop when the player dies. They only stop once the player has left the game.)
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: Healing Players... How?

Post by Logan MTM »

Solve. Thank you guys! :D
Locked

Return to “Editing (Archive)”