function Forward (actionName, actionInputState, actionInputObject) --I need something here to notice if key is down do that Truck.Thrust.Force = Truck.Thrust.force + Vector3.new(100,0,0) wait(0.1) end contextActionService:BindAction("Forward",Forward,true,"t")
Basically what I noted up there. I need some thing at that space possibly an if statement to detect if the t key is down and if it his held. Basically I want Truck.thrust.Force line to run as long as the t key is down not when you press it once or etc.
The key's status is marked with the "actionInputState" parameter. If the keypress starts, then it will have a value of Enum.UserInputState.Begin, or 0. For more information, see: http://wiki.roblox.com/index.php?title=API:Enum/UserInputState
Example:
local function Forward (actionName, actionInputState, actionInputObject) if actionInputState == 0 then Truck.Thrust.Force = Truck.Thrust.Force + Vector3.new(100,0,0) end end game.GetService("ContextActionService"):BindAction("Forward",Forward,true,"t")