local Tool = script.Parent local UserInputService = game:GetService("UserInputService") local Camera = workspace.CurrentCamera local ContextActionService = game:GetService("ContextActionService") function MoveDown() local NewCFrame = Camera.CFrame * CFrame.new(5,0,0) Camera.CFrame = NewCFrame end Tool.Activated:Connect(function() Camera.CameraType= "Scriptable" Camera.CFrame = CFrame.new(Vector3.new(0,10,0),Vector3.new(0,0,0)) ContextActionService:BindAction("MoveCamera1",MoveDown(),true,Enum.KeyCode.S) end)
The error says Argument 2 missing or nil so i would assume that it thinks the funtion is nil i guess pls help
You're passing the return of MoveDown
(nil). You need to pass the function literal. Just remove the parenthesis after MoveDown
. Like so:
ContextActionService:BindAction("MoveCamera1", MoveDown, true, Enum.KeyCode.S)
Please remember to up vote and/or accept my answer, if it helped you.
It should be Enum.KeyCode.S, not "S".