How is this even possible?
The instance method :Connect()
returns an RBXScriptConnection
object, the problem is that velCap
's reference in the lamba function’s definition is out of scope of its declaration.
local r = game:GetService"RunService"
local c
c = r.Heartbeat:Connect(function()
print(c)
end)