I need to hook global touch events. Specifically for prop_physics. How do i do this?
hook.Add( Gamemode:Touch, SomeFunc )
There isn't a hook for touching.
[QUOTE=Chessnut;43503215]There isn't a hook for touching.[/QUOTE]
Aaand...Even if there was, it wouldn't be formatted like that, OP.
Garry's hook system works like so:
[lua]
local function callbackfunction( ... /*parameters*/ )
//Code to be executed when the hook is fired
end
hook.Add("hook_name", "unique_identifier", callbackfunction);
[/lua]
something like that.
Anyway, i think i found it:
[url]http://wiki.garrysmod.com/page/Entity/AddCallback[/url]
[lua]
function GAMEMODE:PropSpawned( ent )
ent:AddCallBack( "PhysicsCollide", MyFunc )
end
[/lua]
I would use [url]http://wiki.garrysmod.com/page/ents/FindInSphere[/url] and a think hook
Sorry, you need to Log In to post a reply to this thread.