I created a weld script which welds a model to the player however the model is incorrectly rotated
The rotation I want is a full 270 degrees around
I am using R15 playermodels
local model = script.Parent.Parent
local button = script.Parent
local model1 = model.Quirk:Clone()
button.Touched:connect(function(hit)
local h = hit.parent:FindFirstChild("Humanoid")
if h then
local char = hit.Parent
if char:FindFirstChild(model1) ~= true then
local quirk = model.Quirk:Clone()
quirk.Parent = char
for i,v in pairs(quirk:GetChildren()) do -- Weld all parts in the model except the primarypart to the model's primarypart
if v:IsA("BasePart") and v ~= quirk.PrimaryPart then
local w = Instance.new("Weld", v)
w.C0 = (v.CFrame:inverse() * quirk.PrimaryPart.CFrame)
w.Part0 = v
w.Part1 = quirk.PrimaryPart
v.Anchored = false
v.CanCollide = false
end
end
quirk:SetPrimaryPartCFrame(char.UpperTorso.CFrame)
local w = Instance.new("Weld", quirk.PrimaryPart)
w.Part0 = quirk.PrimaryPart
w.Part1 = char.UpperTorso
quirk.PrimaryPart.Anchored = false
quirk.PrimaryPart.CanCollide = false
end
end
end)

2 comments
I've created a script but now I have another problem.. the models rotation is incorrect
Nevermind fixed it