function lol(text) print(text) end game.StarterGui:SetCore("SendNotification",{ Title = "hi"; Time = 5; Text = "hlol"; Button1 = "yes"; Button2 = "no"; callback = lol(); })
I tried connecting a callback to a function, but it prints nil everytime with no errors. How do I check which option a player clicked?
A callback needs to be a BindableFunction, not actually a function, this is a short example:
local BindableFunction = Instance.new("BindableFunction") function onClicked(option) if option == "yes" then -- what to do if the player presses yes elseif option == "no" then -- what to do if the player presses no end end BindableFunction.OnInvoke = onClicked -- set our bindable function's oninvoke to our func game.StarterGui:SetCore("SendNotification",{ Title = "hi"; Time = 5; Text = "hlol"; Button1 = "yes"; Button2 = "no"; callback = BindableFunction })