I simply want to move the player, this is the code i have so far (doesnt work):
hook.Add( "SetupMove", "Thing", function( ply, mv, cmd )
cmd:SetForwardMove( 100 )
end )
What? Do you want to move the player forward 100 units? Or just teleport the player?
If you just want to move the player to a position use the Entity/SetPos function.
If you want to move the player 100 units from its position in any direction just use Entity/GetPos and the Entity/SetPos function.
Example:
local newpos = ply:GetPos():Add( Vector( 0, 100, 0 ) ); -- Use the "Add" function to skip the extra vector object creation.
ply:SetPos( newpos );
Could you please elaborate more on what you are trying to do?
Don't do this, that's not gonna move you forward, it's gonna move you 100 units on the y axis, which might not be forward
That is server side not client side.
You should use 10,000 or just set IN_FORWARD with CUserCmd/SetButtons.
hook.Add( "SetupMove", "Thing", function( ply, mv, cmd )
cmd:SetForwardMove( 10000 )
cmd:SetButtons( IN_FORWARD )
end )
Neither did anything
Sorry, you need to Log In to post a reply to this thread.