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

Notification Script not sure wat to do for callback?

Asked by
danglt 185
5 years ago

I'm nor sure what i do for callback, my plan is to if the player picks accept then it will prompt another notification, how would i do this?

sgui:SetCore("SendNotification", {
Title = plrname,
Text = "Sent you a friend request!",
Icon = icon,
Duration = 5,
Callback = WATDOIDO,
Button1 = "Accept",
Button2 = "Decline",
}
)

1 answer

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
4 years ago
Edited 4 years ago

This is one way you can use Callback i have shown you below.

local function CallBack(Value)
    if Value == "Accept" then
        print('Accepted')
    elseif Value == "Decline" then
        print('Declined')
    end
end

local Function = Instance.new("BindableFunction")
Function.OnInvoke = CallBack

sgui:SetCore("SendNotification", {
Title = plrname,
Text = "Sent you a friend request!",
Icon = icon,
Duration = 5,
Callback = BindableFunction;
Button1 = "Accept",
Button2 = "Decline",
}
)

You can find out more information about this by clicking the link below

StarterGui:SetCore

Ad

Answer this question