mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-05-16 08:38:10 +03:00
Updated VScript : Basic Entity Code Tutorial (markdown)
parent
b3e1d6ffe6
commit
73534ac7ed
@ -79,6 +79,8 @@ To make sure `wyatt` actually points to an entity, we use an `if` statement:
|
||||
if (wyatt != null)
|
||||
```
|
||||
|
||||
This `if` statement is "true" if `wyatt` is not `null`.
|
||||
|
||||
Similar to the function, an `if` statement could have its own code which only runs if the statement is true. They can be enclosed with `{` and `}`. In the function itself, it would look like this:
|
||||
|
||||
```squirrel
|
||||
@ -94,7 +96,7 @@ function SetPlayerHealthToNPC()
|
||||
|
||||
Now that we know `wyatt` is an entity which exists, we can get its health.
|
||||
|
||||
First, we'll add a new variable called `health`:
|
||||
First, we'll add a new variable called "health":
|
||||
|
||||
```squirrel
|
||||
local health
|
||||
|
Loading…
x
Reference in New Issue
Block a user