:SetCore SendNotification help

So I was playing around with :SetCore and I was experimenting with notifications;

Here is the script I made:

local CoreGui = game:GetService("StarterGui")

CoreGui:SetCore("SendNotification", {
	Title = "Notification";
	Text = "Is this a notification?";
	Duration = 5;
	--Callback here
	Button1 = "Yes";
	Button2 = "No";
})

image

I was wondering how I could detect if the player clicked button1 or button2 and how to make that run a function, for example print correct if they said yes.

I have tried using bindablefunctions but they haven’t been working.

16 Likes

Just give it a bindable function, not sure how that wasn’t working.

local StarterGui = game:GetService("StarterGui") -- not sure why you used CoreGui
local bindable = Instance.new("BindableFunction")

function bindable.OnInvoke(response)
    print(response .. " chosen")
end

StarterGui:SetCore("SendNotification", {
	Title = "Notification",
	Text = "Is this a notification?",
	Duration = 5,
	Callback = bindable,
	Button1 = "Yes",
	Button2 = "No"
})

Video:

41 Likes

te amo gracias <3 <3 <3 thanks

1 Like

hablas español no soy el unico???

2 Likes