To describe the situation I am using StarterGui:SetCore to send a notification to the player with 2 buttons.
As it says on the linked page, SendNotification uses a bindable function to react to the player pressing the button. This function returns the text of the button pressed.
I have a party system with invites, and I am trying to achieve something like this:
--Localscript
--Send the notification when the event happens
invite.OnClientEvent:Connect(function(inviter)
game.StarterGui:SetCore("SendNotification", {
--Not showing the other things in the list
Callback = bindableEvent --This function invokes when a button is pressed and returns one of these two strings below vv
Button1 = "Accept"
Button2 = "Decline"
})
end)
bindableEvent.OnInvoke = function(option)
--I want the "inviter" value from above to be sent into this remote event to the server, but the function only returns the button text and it can't be changed
ServerEvent:FireServer(option)
end
So basically, I want the inviter value to be sent in the remote event. And the reason I can’t make a variable and set it to the value is because if there are multiple invitation notifications then the value will be set to the last one only.
I can explain more if it doesn’t make sense. Thanks!