Need help with notificationss

local function Notification(Tit, Txt, Dur)
	StarterGui:SetCore("SendNotification",{
		Title = Tit,
		Text = Txt,
		Duration = Dur,
		Button1 = "Yes",
		Button2 = "No",
		Callback = function(...)
			print(...)
		end,
	})
end

Notification("test","test",100)

My script. Doesnt print anything. Does anyone know why?

local StarterGui = game:GetService("StarterGui")

local function Notification(Tit, Txt, Dur)
	local Bind = Instance.new("BindableFunction")
	
	function Bind.OnInvoke(...)
		print(...)
	end
	
	StarterGui:SetCore("SendNotification",{
		Title = Tit,
		Text = Txt,
		Duration = Dur,
		Button1 = "Yes",
		Button2 = "No",
		Callback = Bind
	})
end

Notification("test","test", 100)

Thanks, it works now. Doesnt the bindable need a clean up after that to prevent memory leaks?

1 Like