Updated VScript : Basic Entity Code Tutorial (markdown)

Blixibon 2020-05-29 13:13:12 -05:00
parent a92cbe8491
commit a579b9f758

@ -126,7 +126,7 @@ function SetPlayerHealthToNPC()
Now it's time to set the player's health to this value. This is done in a similar fashion to getting wyatt's health. Now it's time to set the player's health to this value. This is done in a similar fashion to getting wyatt's health.
In entity scripts, there's always a variable called `player` which refers to the player. It can only be used in SP games, like Half-Life 2. In entity scripts, there's always a variable called `player` which refers to the player. It can only be used in single-player mods.
To set the player's health to our new `health` variable, we just use `player` followed by `.SetHealth(health)`: To set the player's health to our new `health` variable, we just use `player` followed by `.SetHealth(health)`: