RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make the player head rotate up, down, left, right, when pressing WSAD"
-- local script in StarterPlayerScripts local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local head = character.Head local function onInput(input, gameProcessed) if not gameProcessed then if input.KeyCode == Enum.KeyCode.W then head.Orientation = head.Orientation + Vector3.new(-10, 0, 0) elseif input.KeyCode == Enum.KeyCode.S then head.Orientation = head.Orientation + Vector3.new(10, 0, 0) elseif input.KeyCode == Enum.KeyCode.A then head.Orientation = head.Orientation + Vector3.new(0, -10, 0) elseif input.KeyCode == Enum.KeyCode.D then head.Orientation = head.Orientation + Vector3.new(0, 10, 0) end end end UserInputService.InputBegan:Connect(onInput)