Things required:
- A place for remote events
- A ‘dummy tool’ to appear in the workspace (a part or mesh that stands in for an actual tool)
- A place for tools to be cloned from
- A server script inside the pickup
- A client script to make the pickup disappear for the player
Here’s the server script, to be placed inside the dummy tool/pickup in the workspace.
When the player touches the part, they get added to a list of players that have touched the pickup. This is important because while the part may disappear on their screen, it still exists in the game’s server, meaning they can still interact with it.
You also have the option of making the pickup part reappear if they die, this could work well for checkpoint systems.
The client side can be placed wherever you decide, but I’d recommend somewhere easily accessed, like ReplicatedFirst.
– (‘events’ would be the folder containing RemoteEvents in ReplicatedStorage)
Once the Pickup event fires, the client destroys the part, which only happens for the player who touched the pickup. Other players will still be able to see it and interact with it as needed.
The option to clone the part back into workspace once the player dies/respawns is also added at the end.
Side note: It’s not really a good idea to have each individual pickup fire the RemoteEvent to respawn, I just stuck it in there for brevity’s sake.
The best way to handle respawning them would be to have a secondary script reload all desired pickups at once and only fire one event.