General > Developers Corner

GMod lua function to set HP?

<< < (3/3)

JamminR:
Both seem like it would overwrite the original Gmod Playerspawn hook.
Shouldn't hook.add be used?

--- Code: ---function myspawnaddhealth
blah
end
hook.Add("PlayerSpawn","SpawnWithHealth", myspawnaddhealth)

--- End code ---

Neku:

--- Quote from: JamminR on March 28, 2014, 05:04:43 PM ---Both seem like it would overwrite the original Gmod Playerspawn hook.
Shouldn't hook.add be used?

--- Code: ---function myspawnaddhealth
blah
end
hook.Add("PlayerSpawn","SpawnWithHealth", myspawnaddhealth)

--- End code ---

--- End quote ---

Oh, my bad, my bad. JamminR would be correct there. You would indeed use a hook
for a function like this.

Navigation

[0] Message Index

[*] Previous page

Go to full version