Logo with title ".Blog"

Maid connect

Published on

Justifying a Connect method on maids.

-- Regular method.
if maid:Alive() then
	maid.heartbeat = RunService.Heartbeat:Connect(function(dt)
		print("delta time", dt)
	end)
end

-- Method if your name is Max.
maid.heartbeat = if maid:Alive() then
	RunService.Heartbeat:Connect(function(dt)
		print("delta time", dt)
	end) else nil

-- Connect method.
maid:Connect("heartbeat", RunService.Heartbeat, function(dt)
	print("delta time", dt)
end)