Cloning only works with one player and breaks after with new players

I’m trying to make a game in which if a player steps on a certain part it clones a part from the ServerStorage to the player and welds it to them, this all works fine but the problem is when its in multiplayer if a new player were to step onto the part it would still clone the script that clones the parts but the script won’t clone the parts onto the player and if the original player were to reset it also wouldn’t copy to him either only if in single player, I’m wondering why this may be.

This is the game in which you can take or test:

I would advise if testing test with the 2 player option so you can see what I’m talking about. If you could help please and thanks.

I found the problem. It’s a very simple fix.

When you clone a part, that part’s parent is nil.
In your script you are cloning a part and using the starter part, without setting a parent for the cloned one, essentially not having a cloned one.

So, instead of

A1:Clone()
A1.Parent = plr
A1.Disabled = false

you do

local newScript = A1:Clone()
newScript.Parent = plr
newScript.Disabled = false

I tested these changes and it worked, change it in your code. Any doubt it should look like this

The script inside the part in workspace, lines 10 to 13 should be

local newScript = A1:Clone()
newScript.Parent = plr
newScript.Disabled = false

The script in ServerScriptService, lines 8 - 11 should be

local A1 = Limb:Clone()
A1.Parent = plr
A1.Weld.Part1 = plr["Right Leg"]
A1.Move.Disabled = false

this should fix it,

happy coding

1 Like

For some reason It works when tested with 2 players but not on actual multiplayer servers would you know why this might be?

Dont worry your way did work I was just dumb and kept it in a loop lol, thanks.