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: