Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

[Bug] Pickup and DropItem events didn't work #19

Open
AlexMog opened this issue Feb 23, 2021 · 0 comments
Open

[Bug] Pickup and DropItem events didn't work #19

AlexMog opened this issue Feb 23, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@AlexMog
Copy link
Owner

AlexMog commented Feb 23, 2021

As I was fearing, the inventory is managed on the client-side, I will see if I can manage a way to force inventories update and listen on these events.

If you have any ideas, do not hesitate !

More info:
Pickup an item process (as I have understood by retro-engineering the code):
When a player pickup an item:
-> Humanoid.Pickup is called on client side
-> Humanoid.Pickup calls ItemDrop.Pickup
  -> If ItemDrop.CanPickup() returns true (that means that the client is the owner of this object (Client is the owner = the server leaves the responsibility of the status of that item to the client, it's not the server who controls it anymore))
    -> The local inventory is updated with the item, the client destroys the item
  -> Else
    -> The client sends a "RequestOwn" packet (to ask the server for the ownership of this item) and waits that the ownership of the item switch to the client
    -> When the ownership switched to the client, the item is added to the client's inventory

That's exactly why it is very tricky to handle. The server is not authorative, and we will need tricks to handle it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant