• More instances of one hook
    1 replies, posted
I'm pretty sure TTT uses the PlayerDeath hook to make a ragdoll. If I use that same hook for an addon, will death in TTT work normally?
Yes, as long as the hook identifier string is not the same. A hook is made in each hook as a seperate realm, and then identified by a string, so: [code]hook.Add("DoPlayerDeath", "MyCoolHook", CoolFunction)[/code] Will run with [code]hook.Add("DoPlayerDeath", "SpaceHook7", CoolFunction)[/code] and [code]hook.Add("HUDPaint", "MyCoolHook", CoolFunction)[/code] But if you do another hook like this one: [code]hook.Add("DoPlayerDeath", "MyCoolHook", AnotherFunction)[/code] It will overwrite the first one. You can also remove your hook but you have to specify which hook and which identifier, with: [code]hook.Remove("DoPlayerDeath", "MyCoolHook")[/code] Also some hooks have "return" values and if you return false the other hooks will not run. Also, if one of your hook's lua breaks and errors, the remaining hooks will also not be run.
Sorry, you need to Log In to post a reply to this thread.