Hey dev’s! What are the movements called on roblox? I only know the Left And Right movements, but the S and W key’s i dont. Please Help.
script:
local player = game.Players.LocalPlayer
local RunService = game:GetService(“RunService”)
local ContextActionService = game:GetService(“ContextActionService”)local jumping = false
local LeftValue, rightValue, downValue, upValue = 0, 0, 0, 0local function OnLeft(actionName, inputState)
if inputState == Enum.UserInputState.Begin then
LeftValue = 1
elseif inputState == Enum.UserInputState.End then
LeftValue = 0
end
endlocal function OnRight(actionName, inputState)
if inputState == Enum.UserInputState.Begin then
rightValue = 1
elseif inputState == Enum.UserInputState.End then
rightValue = 0
end
endlocal function OnDown(actionName, inputState)
if inputState == Enum.UserInputState.Begin then
downValue = 1
elseif inputState == Enum.UserInputState.End then
downValue = 0
end
endlocal function OnUp(actionName, inputState)
if inputState == Enum.UserInputState.Begin then
upValue = 1
elseif inputState == Enum.UserInputState.End then
upValue = 0
end
endlocal function OnJump(actionName, inputState)
if inputState == Enum.UserInputState.Begin then
jumping = true
elseif inputState == Enum.UserInputState.End then
jumping = false
end
endlocal function OnUpdate()
if player.Character and player.Character:FindFirstChild(“Humanoid”) then
if jumping then
player.Character.Humanoid.Jump = true
end
local MoveDirection = rightValue - LeftValue
player.Character.Humanoid:Move(Vector3.new(MoveDirection,0,0), false)
end
endRunService:BindToRenderStep(“Control”, Enum.RenderPriority.Input.Value, OnUpdate)
ContextActionService:BindAction(“Left”, OnLeft, true, Enum.KeyCode.A, Enum.KeyCode.Left, Enum.KeyCode.DPadLeft)
ContextActionService:BindAction(“Right”, OnRight, true, Enum.KeyCode.D, Enum.KeyCode.Right, Enum.KeyCode.DPadRight)
ContextActionService:BindAction(“Backward”, OnDown, true, Enum.KeyCode.S, Enum.KeyCode.Down, Enum.KeyCode.DPadDown) – [I am stuck on this one.]
ContextActionService:BindAction(“Jump”, OnJump, true, Enum.KeyCode.Space, Enum.KeyCode.Up ,Enum.KeyCode.ButtonA)