Only one local script is listening to my remote event

I’ve got this situation where there’s a remote event, between a server and a client. This remote event is used to send information about the inventory from the server to the client.

Now, on the client side, I’ve set up two separate pieces of code, or scripts, to handle this incoming inventory data.

The first script is responsible for creating objects in the client’s virtual world based on the inventory data it receives. Think of it like building structures or items in a game.

The second script deals with selling these inventory items. So, when the player decides to part with an item, this script takes care of the selling process.

Here’s the actual code that listens for the inventory updates:

luaCopy code

STC.UpdateInventory.OnClientEvent:Connect(function(D)
    Data = D
    print(Data)
end)

Now, here’s where it gets tricky: When I have both of these scripts running simultaneously, there’s a problem. Only one of them seems to work correctly at any given time. It’s like they’re taking turns, and if I deactivate one of them, the other springs into action.

So, the challenge here is to figure out how to make both of these scripts operate smoothly together, allowing the client to build objects and sell inventory items without interfering with each other.

1 Like

what are both of the localscripts parented to, localscripts only work in these

1 Like

The parent has nothing to do with my issue because of the following

  1. If the parent was the issue the entire script wouldnt work
  2. I am pretty sure that as long as the script can run it should accept remote events

But the script does work. The only thing that doesnt work is the remote event.

For more details, re-read my post.

1 Like

Did you end up finding a solution? I’m having the exact same problem.

this is an issue with remote events, only 1 script can listen to them at a time,

a bindable event can have infinitive listeners to it tho

take your remote event… put a script and a bindable event in that remote event,

whenever you trigger the remote event, trigger the bindable event and let the scripts listen to the bindable event

Yes I believe I did find a solution. I think I put a wait in front of one of the remote function listeners. I think there was some weird thing were it couldn’t process multiple receivers at the same time so you have to wait a bit. If that doesn’t work let me know and I can check specifically what I did

Thats not true because exploiters can stll access remote events even though they are connected to other scripts

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.