I have a model in Server Storage. The model contains simple Parts(Parts/Unions) that contain one part that has a weld to all the other parts. Its a PrimaryPart of the model so I will be able to move the model.
Im trying to Clone the model and weld it on the player, it works. However, when I die (reset for example) and I try to Clone and weld the model again - it wont work. The model it self gets cloned perfectly. But its Children (the parts) wont clone. I just get an empty Model inside the character.
ServerScript:
local helmet = ss.Helmet:Clone()
local p = helmet.Neck --Acts as a PrimaryPart
local w1 = Instance.new("Weld", p)
w1.Name = "HelmetWeld"
function SuitUp(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local FindHelmet = char:FindFirstChild("Helmet")
if not FindHelmet then
print("lol") --This runs all the time.
helmet.Parent = char
p.CFrame = char.Head.CFrame
w1.Part0 = p
w1.Part1 = char.Head
w1.C0 = CFrame.new(0, -0.012, 0)
w1.C1 = CFrame.Angles(math.rad(1), math.rad(270), 0)
end
end
I also have a cooldown in my LocalScript to prevent spam.
Local Script:
hasSuit = false
script.Parent.MouseButton1Click:Connect(function()
if hasSuit == false then
remote:FireServer()
hasSuit = true
end
end)

2 comments
and replace if not FindHelmet then with if FindHelmet then so it looks for it and not that its not there
I dont want the player to be able to click the button multiply times. I want him to get the helme and thats it. When he dies you can take a new suit. Also I check to see if theres a helmet inside him to see if I need to give him one or not. If there is no helmet then give him one.