Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a look back script while in first person?

Asked by 4 years ago

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)

0
Looking to make something similar but I to don't know how ;-; DisNoobHasRobux 0 — 4y

Answer this question