I'm looking to make a script where if you press/hold q it makes your character look back while your w still makes you go forward which would no longer be the way you are looking since you are looking back and if you let go of q it stops.
I got this far but am stuck on what I should do:
local player = game.Players.LocalPlayer local camera = workspace.CurrentCamera local mouse = player:GetMouse() local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Keyboard then local keyPressed = input.KeyCode if keyPressed == Enum.KeyCode.Q then camera.CFrame = CFrame.Angles(360, 0, 0) end end end)
UIS.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
local keyPressed = input.Keycode
if keyPressed == Enum.KeyCode.Q then
camera.CFrame = CFrame.Angles(-360, 0, 0)
end
end
end)