Not cloning when the mask model is inside replicated storage

I have a mask model inside the replicated storage.
image

I am using this script to clone it and attach it to the starter player’s front face attachment when a player will join the game and it is working (Attaching to the front face attachment) when the mask model is inside the workspace but not working when the model is inside replicated storage. Here is the server script I am using(Placed inside serverscriptserviece):

local mask = game.ReplicatedStorage:WaitForChild("face"):Clone()

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		
		
		mask.face.RigidConstraint.Attachment1 = Character.Head.FaceFrontAttachment
		
		
		
	end)
end)

So, you arent parenting the cloned mask to workspace, which is why you cant see it.

You might want to wait for the head aswell, just to avoid any possible errors.

And you’ll also want to clone the mask when the player joins, or else there will only be one, and the script will reposition the mask instead of creating a new one.


game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)

		local mask = game.ReplicatedStorage:WaitForChild("face"):Clone()
		mask.Parent = Character:WaitForChild("Head")
		mask.face.RigidConstraint.Attachment1 = Character.Head.FaceFrontAttachment
		
	end)
end)
1 Like

Make sense, thank you so much, it is working perfectly.