Entity.GetMoveType

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetMoveType( )
Description:
Returns the entity's Move Type as a movetype enumeration.
Returns: enum
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetMoveType]Entity.GetMoveType [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis is an example of how to use GetMoveType to make sure people don't use NoClip.
Used onNewerShared.png
Code
function BlockNoclip(ply)
	if (ply:GetMoveType()==MOVETYPE_NOCLIP) then
		ply:SetMoveType(MOVETYPE_WALK)
	end
end
hook.Add("PlayerNoClip", "MyNoclipHook", BlockNoclip)
OutputIf The player tries to use noclip, then they will be set to the default move type. This means that when they try to fly through walls, they will instantly lose noclip and have to walk.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox