How to use bindable functions in this way?

I am currently making a game that uses bindable functions, I am newish to bindable functions and when I try to ignore a call from the player that sent it, it always returns nil, How to ignore the call without it returning nil? If this is not possible is there anyway/any how to make the bindable functions continue until it gets a valid answer?

Bindable functions do not send a player by default. They are simply functions that can be invoked. That’s why it returns nil.

I think you’re confusing BindableFunctions and RemoteFunctions.

I don’t think you understand, I am using the bindable functions as a client-client communication. I have sent the caller’s userid with the invoke and in the onInvoke I check if its the same as the clients then if it is I ignore it, but It returns nil, I am looking for a way to ignore that call as a whole, I guess.

If there is a better way to do this, I am fine with that too.

You cannot exactly ignore a call after it is connected, but you can always return nil.

I don’t expect a scenario where the client’s UserId won’t be the same as the local player’s, since BindableFunctions, on the client, can only communicate to the local player.

So, I’m not sure if I understand this properly if that’s the case.

The bindable function is not made on the client, if that is what you are saying. It connects to the other clients but the other clients get the call from themselves first.

If a BindableFunction / BindableEvent is invoked from one client, it will not fire other clients. You need to use a RemoteEvent / RemoteFunction for this.

Anyways, solving the problem:

I made a BindableEvent connect to a function that had the player as the first argument. If the player was the local player, then it would stop the function.

If I intentionally wanted to make the local player fire, I would pass the first argument (the player) as nil intentionally.

I need to get a return value back from the other clients so this will just not do.

The other clients are not the current client, so it would return nothing.

If you want to prevent it from running, you must do that from the server. Remember: BindableFunctions do not send from one client to another, I tried that. They send from one point of the same client to another point.

I’ve thought about a way to fix this issue, if this does not work, I’ll be back.

I fixed it, finally thank you I did not know bindable functions didn’t call to other clients.

1 Like