How do you lower the players camera when pressing a key?
Asked by
5 years ago Edited 5 years ago
I am trying to make a crouch script for a fps. The camera is supposed to move down and up depending if they are crouching or not.
01 | mouse.KeyDown:Connect( function (key) |
02 | if key = = "c" and crouching = = 1 then |
04 | h.WalkSpeed = h.WalkSpeed - 15 |
05 | h.JumpPower = h.JumpPower - 60 |
07 | cam.CFrame = cam.CFrame - Vector 3. new( 0 , 5 , 0 ) |
08 | script.Parent.CrouchNonfication.Text = "Crouching" |
10 | elseif key = = "c" and crouching = = 3 then |
12 | h.WalkSpeed = h.WalkSpeed + 15 |
13 | if p.Perk.Value = = "Kangaroo" then |
18 | cam.CFrame = cam.CFrame + Vector 3. new( 0 , 5 , 0 ) |
20 | script.Parent.CrouchNonfication.Text = "" |