I’m trying to weld the sheathe to the bottom left of the player’s torso, but I can’t seem to get the position and rotation correct. I don’t know scripting that well so sorry if what I’ve written makes no sense ):
This is how it’s supposed to look like:
But if the player moves around, the sheathe will still rotate in the same direction:
I’ve tried looking up CFrames, been onto the roblox developer site, asked around in HD, but can’t seem to find anything helpful.
local RS = game:GetService("ReplicatedStorage")
local tool = script.Parent
tool.Equipped:Connect(function()
local torso = tool.Parent:FindFirstChild("Torso")
if not tool.Parent:FindFirstChild("Sheathe") then
local sheathe = RS.SheatheStuff:WaitForChild("Sheathe"):Clone()
sheathe.Parent = tool.Parent
local handle = RS.SheatheStuff:WaitForChild("Handle"):Clone()
handle.Parent = tool.Parent
sheathe.CFrame = CFrame.new(torso.Position + Vector3.new(-.01 ,-.01, 0)) * (torso.Orientation + CFrame.Angles(math.rad(45), 0, 0))
handle.a.CFrame = CFrame.new(sheathe.Position + Vector3.new(0,1,-3.6)) * CFrame.Angles(math.rad(200), 0, math.rad(180))
handle.b.CFrame = CFrame.new(sheathe.Position + Vector3.new(0,1,-3.6)) * CFrame.Angles(math.rad(200), 0, math.rad(180))
handle.c.CFrame = CFrame.new(sheathe.Position + Vector3.new(0,1,-3.6)) * CFrame.Angles(math.rad(200), 0, math.rad(180))
handle.d.CFrame = CFrame.new(sheathe.Position + Vector3.new(0,1,-3.6)) * CFrame.Angles(math.rad(200), 0, math.rad(180))
local weld = Instance.new("WeldConstraint")
weld.Parent = sheathe
weld.Part0 = sheathe
weld.Part1 = torso
local weld2 = Instance.new("WeldConstraint")
weld2.Parent = sheathe
weld2.Part0 = sheathe
weld2.Part1 = handle.a
end
end)
The main problem is the line that says sheathe.CFrame = …