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 isnt saying anything is wrong with it. Please help this script is in a local script in starterpack

1 comment
In line 26, why are you returning weld? Take that part out.