Attempt to call a RBXScriptSignal value (tostring error)

im making a camera system when someone press a button it changed to the next one, camera are parts with the pattern “C1” (so the others are “C2”, “C3”, etc)

the one where i assign the first camera works

local CurrentCamNum = 1

CurrentCam.CFrame = Cam_Folder:FindFirstChild("C".. tostring(CurrentCamNum)).CFrame

but switching to the other cameras is where i got stumped, i have to guess its probably has to do with how i tried adding the CurrentCamNum value or the function…?
prints does not print, not even the “test” one works

local function next_story()
	print("test")
	local Changed_Cam = "C".. tostring(CurrentCamNum + 1)
	
	print(Changed_Cam)
	task.wait()
end

Story_GUI.Next.MouseButton1Click:Connect(CurrentCam.Changed(next_story)) -- this is the line error

as always any help is more than appreciated, thanks!

Am I missing something here?

You’re trying to pass in a RBXScriptSignal as an argument into a Connect method. You are unable to do this. The only thing you’re allowed to pass in is a function.

oh wow i didn’t know that, and yup it works after removing the Changed argument :person_facepalming:

thanks!

You can actually use Connect this way and even get tiny performance benefits.

local signal = game.Loaded
local Connect = signal.Connect


Connect(game:GetService("Players").PlayerAdded,function(plr:Player):()

end)

An example