Ok so I'm making a custom sword system and have made it so the weapon the player has displays on the side of their charater, the only problem is, if they are facting any direction, other than that at which they are spawned in, the sword isnt rotated correctly.
I know I'm missing some code or need to edit another bit of code, but am unsure as to what. Any help?
My current code is this:
while wait() do
if not script.Parent:FindFirstChild("SwordDisplay") then
local Plr = game.Players:GetPlayerFromCharacter(script.Parent)
if not script.Parent:FindFirstChildOfClass("Tool") then
local SG = Plr:WaitForChild("StarterGear")
local Foundtool = SG:FindFirstChildOfClass("Tool")
if Foundtool then
local Handle = Foundtool.Handle
local Clone = Handle:Clone()
local NewWeild = Instance.new("Weld", Clone)
NewWeild.Part0 = script.Parent.HumanoidRootPart
NewWeild.Part1 = Clone
Clone.Parent = script.Parent
Clone.Name = "SwordDisplay"
Clone.Orientation = Vector3.new(-17.5, 180, 0)
Clone.Position = (script.Parent.HumanoidRootPart.Position + (script.Parent.HumanoidRootPart.CFrame.RightVector + script.Parent.HumanoidRootPart.CFrame.LookVector) * -1.05) - Vector3.new(0,1.5,0)
end
end
end
end

2 comments
Btw its Y axis not level :/
oof