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

CFrame incorrect use?

Asked by 8 years ago
script.Parent.MouseButton1Click:connect(function()
local ac = script.Parent.Parent.Parent.Parent.TargetFolder.Accessory
ac.Value = script.Parent.Name
local Lo = game.ServerStorage.Accessories:GetChildren()
local ply = game.Players.LocalPlayer
local char = ply.Character
for i = 1, #Lo do
    if Lo[i].Name == ac.Value then
        local Acc = Lo[i]:Clone()
        Acc.Parent = char.Chest
        local Weld = Instance.new("Weld")
        Weld.Part0 = Acc
        Weld.Part1 = char.Chest.Middle
                Weld.C1 = char.Chest.Middle.CFrame:inverse()*CFrame.new(0,0,0)
                Weld.C0 = Acc.CFrame:inverse()*CFrame.new(char.Chest.Middle.Position)
                Weld.Parent = Acc
    end
end
end)

--There isn't any errors, it loads fine, the only issue is the whole fact it wouldn't position where I want it to go.

0
Please don't just give us code and tell us to solve your problem, elaborate what your problem is and what you've tried. drahsid5 250 — 8y

Answer this question