RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a control script so players can only move on one axis"
-- local script local UserInputService = game:GetService("UserInputService") local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local function restrictMovement(input) if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S then humanoid:Move(Vector3.new(0, 0, input.Position.Z), true) end end UserInputService.InputBegan:Connect(restrictMovement)