Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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.

0
thanks ashstitchedmyface 7 — 3y
Ad

Answer this question