Need help in making a Player independent chest system

I am stuck and don’t know what to try, how to approach solving the problem.
Would really appreciate some ideas to make it work.

What I am trying to achieve:
I want to have some treasure chests, the same set for each player, so they all can open each chest without interfering with other players’ chests.

Players can come to the obstacle course at any time while other players might already be halfway through the course, and opened half of their chests, they found.

I made the chest fully work while it is part of the Workspace. It has ProximityPrompt, opening lid, effects, gives the currency, etc. everything working perfectly.
After this I am attempting now to make them player independent, so players are not opening a common set of chests but instead each player has their own copy of all chests to interact with.

I made a server script that on PlayerAdded sends a RemoteEvent to a local script that clones all the chests into the Workspace for that particular player. So these chests for particular player are not on the server only on the client (each player will have their on set of chests)

The issue:
For some reason, I can’t get even a simple script (or local script) to run (just simply doing one print command) inside these cloned/local versions of chests.

What am I missing?
Do you have any idea what I should try to figure this out?

OR should such a player-independent-chest-system be solved some other way?

Thanks in advance for any guidance!

1 Like

What I was confused about is where server and local scripts can be and where they work.
Without any error messages, it took me considerable time to figure the issue out.

Issue:
The treasure chest that worked nicely with all server scripts inside it, while it was in the Workspace stopped working after I moved it to ReplicatedStorage and used a LocalScript to clone it into the workspace, FOR THE LOCAL PLAYER(S).
In this setup, the server scripts do nothing, do not run as they are only in the client’s workspace, and throw no errors to help figure the issue out for noobs like me.
1st I tried to replace them with local scripts, thinking that would work, but then realized that local scripts can only be in specific places. Details here: Roblox Client-Server Model

Solution:
After acknowledging this it was easy, just had to make local scripts inside the StarterPlayerScripts to do all the interaction of the treasure chest which was previously done by server scripts inside the chest groups.

1 Like