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

Whats wrong with my welding?

Asked by
neoG457 315 Moderation Voter
9 years ago
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(key)
if key == "p" then

local RinkakuModel = game.ReplicatedStorage.WorkspaceRinkakuModel:Clone() --Assuming the model is now in ReplicatedStorage
local primary_part = RinkakuModel.Primary -- Since this is used a lot, let's store it in a temporary variable
RinkakuModel.PrimaryPart = primary_part

local w = Instance.new('Weld')
w.Part0 = primary_part
w.Part1 = Player.Character.Torso
w.C0 = CFrame.new(0, 10, 0)
w.Parent = primary_part

primary_part.Anchored  = true -- Not sure if you still need to anchor it, if not you can leave it out.
for index = 1, 15 do
    local part = RinkakuModel["Part" .. index] -- This will generate Part1 till Part15
    local weld = Instance.new("Weld")
    weld.Part0 = primary_part
    weld.Part1 = part
    weld.C1 = part.CFrame:toObjectSpace(primary_part.CFrame)
    weld.Parent = primary_part
    part.Anchored = true -- Same here with the anchoring
    return weld
end


RinkakuModel:SetPrimaryPartCFrame(Player.Character.Torso.CFrame * CFrame.new(0, 10, 0))-- It's probably a good idea to use SetPrimaryPartCFrame before parenting it.
RinkakuModel.Parent = workspace

RinkakuModel:MakeJoints()-- You don't need to use MakeJoints because you did that manually
RinkakuModel.Name = Player.Name

end
end)

This script should clone WorkspaceRinkakuModel into workspace and weld the clone to my torso but its not working the output isn't saying anything is wrong with it. Please help this script is in a local script in starterpack.

This is WorkspaceRinkakuModel: http://www.roblox.com/WorkspaceRinkakuModel-item?id=231758963

0
Please be patient with your questions. It is unnecessary to re-submit the exact same question: you are able to edit your questions. Do so! adark 5487 — 9y
0
The way this model is set up, you can't use joints. You'll have to create a seperate weld for each part. I might write a code to do it for you later. aquathorn321 858 — 9y

Answer this question