Clone on the Client (not working)

I want to clone some parts to be collected in the workspace, but I want to clone on the client, for when a player collects, it still remains visible and collectible for the other player on other client.

local parts = game.ReplicatedStorage.Parts

game.Players.PlayerAdded:Connect(function()

local partClone = parts:Clone()
partClone.Parent = workspace

end)

I made this: if i leave it in server-script, the parts are cloned to workspace, but not on client. and if i leave it in localscript, doesnt clone.

how can I clone on the client? my folder with the parts are in ReplicatedStorage

  • Step 1: Insert a LocalScript inside StarterPlayerScripts

  • Step 2: Put this code inside the LocalScript:

print("Local Script Online")
local Parts = game.ReplicatedStorage.Parts

local PartClone = Parts:Clone()
PartClone.Parent = workspace
print("Parts cloned to the workspace locally")

In case if you weren’t aware, LocalScripts can only work if they are descendants of:

  • StarterPack
  • StarterGUI
  • StarterPlayer/StarterCharacterScripts
  • ReplicatedFirst Service
  • Parented inside Tools

API Reference:

make a local script that uses remote event if u want in server and if u want only player to see spawn on local script.

The PlayerAdded event does not fire on the client for itself, it can only fire when other players join the game.