Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Model Cloning script not working perfectly? Help fix please?

Asked by 10 years ago

This script clones the model just like I want, but when it is cloned it falls apart. I tested it without cloning and it stays together, what is wrong?

script.Parent.MouseButton1Down:connect(function()
for _,v in pairs(game.Players:GetPlayers()) do

if v.leaderstats.Wood.Value >= 20 then
v.leaderstats.Wood.Value = v.leaderstats.Wood.Value - 20
local pt = game.ReplicatedStorage.Raft:Clone()
pt.Parent = workspace
pt.Position = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p + Vector3.new(0,5,5) 
else return end
end
end)

1 answer

Log in to vote
1
Answered by
Bebee2 195
10 years ago

After line 7, add this line:

pt:MakeJoints()

What this method does is automatically connect parts based on their side formation (like studs, glue, weld) which sometimes fixes this kind of problem.

0
thanks, worked perfectly Shaydesilva 85 — 10y
Ad

Answer this question