Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm having trouble with a sendnotification script I'm trying to make a button function, help?

Alright, so basically I already have a notification that appears. But I need help on something. I'm wondering if there's a way to make one of the buttons connect a function/activate something.

wait(0.3)
if game.Players.LocalPlayer then
	game.StarterGui:SetCore('SendNotification', {
		Title = 'hi there',
		Text = 'Welcome',
		Button1 = 'Thanks',
		Button2 = 'ok bye',
		Duration = 5,
	})
end

So I have this, now I'm wondering if there's a way to make one of the buttons connect a function/activate something.

1 answer

✓ Accepted answer

You will have to pass a BindableFunction with the key being Callback inside the config table.

When the player clicks the button, the BindableFunction will fire, and the OnInvoke callback function will fire with the button's name as a parameter. Though, be sure to set the OnInvoke callback function.

Here is the API reference for BindableFunction for further reference.

1 comment

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.