• Restrict constraint
    4 replies, posted
Hello, Is it possible to get some kind of hook which gets called when a player applies a certain constraint to a certain prop? I'm trying to restrict the amount of props that can be constraint to a single entity, but I haven't found a way yet to do so. Thanks in advance
You may overwrite the constraint function for that if you don't find a hook.
[QUOTE=Wizard of Ass;26639120]You may overwrite the constraint function for that if you don't find a hook.[/QUOTE] Thanks for your reply! Could you perhaps show me an example of how to do that?
After some searching on the forums, I figured out how to overwrite a function, quite easy actually. Thanks! [code] constraint.Weld = function(Ent1, Ent2, Bone1, Bone2, forcelimit, nocollide_until_break) // Code here (note that the original Weld is not being called now) end [/code]
Uh that wouldn't work, you'd need to do [lua] local oldweld = constraint.Weld constraint.Weld = function(Ent1, Ent2, Bone1, Bone2, forcelimit, nocollide_until_break) // Code here (note that the original Weld is not being called now) return oldweld(Ent1, Ent2, Bone1, Bone2, forcelimit, nocollide_until_break) end [/lua] iirc
Sorry, you need to Log In to post a reply to this thread.