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.