I need for the gravgun to be able to pickup the prop that i used this code on.
[lua]
function GM:GravGunPunt( ply, target )
target:SetMoveType(MOVETYPE_NONE)
end
[/lua]
^^Works like a charm
I have tried this script below but it doesn't work for picking it up agan.
[lua]
function GM:GravGunOnPickedUp( ply, target )
target:SetMoveType(MOVETYPE_VPHYSICS)
end
[/lua]
Also, how do i change the strength of the Gravgun so it can pickup anything.
If enabling movetype doesn't seem to work, try one of two things:
1. Get the entity's physics object and use [b][url=wiki.garrysmod.com/?title=PhysObj.EnableMotion]PhysObj.EnableMotion [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
2. [b][url=wiki.garrysmod.com/?title=Constraint.Weld]Constraint.Weld [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] it to the world
With enable motion its this yeh?
[lua]
function GM:GravGunOnPickedUp( ply, target )
PhysObj:EnableMotion( target, enable )
end
[/lua]
Weld would stop me being able to pick it up, not make me able to though :S
[editline]12:05AM[/editline]
I'm now using this but it doesn't work (the unfreeze)
[lua]
function GM:GravGunPunt( ply, target )
target:SetMoveType(MOVETYPE_PUSH)
end
function GM:GravGunOnPickedUp( ply, target )
PhysObj:EnableMotion( target, enable )
end[/lua]
Sorry, you need to Log In to post a reply to this thread.