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)
your script:
hasSuit = false script.Parent.MouseButton1Click:Connect(function() if hasSuit == false then remote:FireServer() hasSuit = true end end)
replace with hasSuit = false
script.Parent.MouseButton1Click:Connect(function() if not hasSuit then--checks if its false and if its not then it runs the function hasSuit = true--makes it true so u cant run the function remote:FireServer() wait(1) hasSuit = false--sets it back to false after 1 second so u can run the function again end end end)