• Trying to integrate hook into a functions breaks the function
    2 replies, posted
Hi I'm trying to call hooks whenever a prop gets un-/frozen but after running the code I can't freeze anything anymore. [CODE]oldfrz = oldfrz or _R.PhysObj.EnableMotion function _R.PhysObj:EnableMotion(bool) local ent = self:GetEntity( ) if bool then hook.Call("EntUnfreeze",GAMEMODE,ent,self) else hook.Call("EntFreeze",GAMEMODE,ent,self) end self:oldfrz(bool) end[/CODE] 2. problem how can I make the hook control whether or not I can un-/freeze a prop if i return false in it?
hook.Call will return whatever function that it calls returns smth else than nil first
Haha thanks! (some of those solutions which are too easy to think of^^) Also I solved my first problem by replacing the first line with: [code]_R.PhysObj.oldfrz = _R.PhysObj.oldfrz or _R.PhysObj.EnableMotion[/code] Thread solved.
Sorry, you need to Log In to post a reply to this thread.