Gamemode.SetPlayerSpeed

From GMod Wiki

Revision as of 15:21, 17 February 2011 by BlackVoid (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameSetPlayerSpeed
SyntaxGM:SetPlayerSpeed( Player ply, Integer walk, Integer run )
DescriptionSetPlayerSpeed allows us to override the players speed.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.SetPlayerSpeed]Gamemode.SetPlayerSpeed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis example makes the default movement speed 250 and makes the sprint speed 500.
Used onNewerServer.png
Code
function playerSetSpeed(ply)
 
	GAMEMODE:SetPlayerSpeed(ply, 250, 500)
	// 250 is the default move speed
	// 500 is the speed when you hold the sprint key
end
 
hook.Add( "PlayerSpawn", "playerSetSpeedtest", playerSetSpeed )
OutputThe player moves at 250 and he sprints at 500.


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox