I assign g as the key but when i press other buttons the code still run help?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
it might be a stupid error but every time i press a key my camera changes the problem is that i assigned g as the key and for some reason any button i press it runs the code and i'm not sure why here is the code.
02 | mouse = game.Players.LocalPlayer:GetMouse() |
04 | mouse.KeyDown:connect( function (key) |
10 | mouse.KeyUp:connect( function (key) |
16 | local target = workspace.Part |
17 | local camera = workspace.CurrentCamera |
18 | camera.CameraType = Enum.CameraType.Scriptable |
19 | camera.CameraSubject = target |
21 | camera.CoordinateFrame = CFrame.new(target.Position) |
22 | *CFrame.new( 2.9 , 4.6 ,- 22 ) |
23 | *CFrame.Angles( 0 ,- 3.1 , 0 ) |
25 | game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid |
26 | game.Workspace.CurrentCamera.CameraType = "Custom" |