firstly, your first line is commented out, and you should be defining tween service before this event function. also is this a client script or a server script? because contextactionservice only works on client.
do you want it to shake when you shoot or when you equip?? because you have to make a function to take advantage of the contextactionservice. you’ve already referenced the HandleAction function, you just need to create it, such as here:
local TweenService = game:GetService("TweenService")
function HandleAction(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.Begin then
local OriginalCamera = Humanoid.CameraOffset
local TweenService = game.TweenService
local RandomOffset = Vector3.new(
math.random(-2.9, 2.9),
math.random(-2.9, 2.9),
math.random(-2.9, 2.9)
)
TweenService:Create(Humanoid, TweenInfo.new(0.1), {CameraOffset = OriginalCamera + RandomOffset}):Play()
end
end
also i don’t know why you have ButtonConnection = Button.MouseButton1Up:Connect(OnButton) because that is not doing anything.