CMoveData.SetForwardSpeed

From GMod Wiki

Jump to: navigation, search
Function
Syntax MoveData:SetForwardSpeed( Number )
Description:
Sets the Forward speed on 100 every time the player presses the W key
Returns: nil
In Object: Cmovedata
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=CMoveData.SetForwardSpeed]CMoveData.SetForwardSpeed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the Forward speed on 100 every time he presses the W key
Used onNewerShared.png
Code
 
local move = 0
hook.Add("SetupMove","SetForwardSpeed", function(ply,movedata)
      if (movedata:IsPlayer() && movedata:KeyPressed( IN_FORWARD )) then
          move = move + 100
          movedata:SetForwardSpeed(move)
      end
end)
 
OutputSets the Forward speed on 100 every time he presses the W key, 100, 200, 300, 400


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox