Type '(any) -> ()' could not be converted into '(any) -> g52'

BindableEvent invoke gives strange error.

OnButtonPressed.OnInvoke = function(Response)

In the script editor this is underlined for some reason.

When I hover on it, it says " Type ‘(any) -> ()’ could not be converted into ‘(any) -> g52’ ". Can anyone tell me how to fix this?

I am using --!strict by the way, please don’t ask me to remove it, I want to solve this error without removing strict.

1 Like

Do you have any code within that function yet? If so, what is it and what are you returning? Also, I assume you mean a RemoteFunction and not a RemoteEvent?


@sleitnick @taker4300
It’s a BindableFunction.

Here is the code, its being used in SendNotification by the way.

local OnButtonPressed: BindableFunction = Instance.new("BindableFunction")

OnButtonPressed.OnInvoke = function(Response: string)
	if (Response == "Yes") then
		return true
	return false

OnButtonPressed.Parent = script

		Title = "place holder",
		Text = "place holder",
		Icon = "place holder",
		Button1 = "Yes",
		Button2 = "No",
		Callback = OnButtonPressed

I think this is just a bug with the type-checker, or at least with the configuration of BindableFunctions. Your code is valid. It only one return type (boolean), and the type-checker seems to pick up on that fine.

I wonder what “g33” is supposed to be?


Whats the error? you just added the “: string” thing but you didnt explain whats wrong

I have mentioned it in the screenshot.

My bad, sorry it was really small that not enough to me notice it.

Have you tried specifying the return of the function? Whatever g33 is could be a default that’s throwing it off.