So I was making a sword that goes on the hip but when I finish it and test play it the sword is not on the hip and you can't see the sword. I used the Classic Sword made by roblox and insert a local script in it and type this
while wait do
if script.Parent.Parent.Name == "Backpack" then
local Character = script.Parent.Parent.Parent.Character
if Character then
local Torso = Character:FindFirstChild("UpperTorso")
local Weapon = Character:FindFirstChild(script.Parent.Name)
if Torso and not Weapon then
local WeaponOnHip = Instance.new("Model")
WeaponOnHip.Name = script.Parent.Name
WeaponOnHip.Parent = Character
Handle = script.Parent.Handle:Clone()
Handle.Name = "Handle"
Handle.Parent = WeaponOnHip
local LegWeld = Instance.new("Weld")
LegWeld.Name ="WeldOnLeg"
LegWeld.Part0 = Torso
LegWeld.Part1 = Handle
LegWeld.C0 = CFrame.new(1,-1.42,0.5)
LegWeld.C0 = LegWeld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(-150),math.rad(-180),-20.5)
end
end
else
if Handle.Parent then
Handle.parent:Destroy()
end
end
end
And there's no error in the output

6 comments
Try putting it in serverscriptservice
didn't work
didn't work
I mean serverscriptservice. Not local script.
you should make a varible for line 22 then set the C0 to that varible plus the equation?
The only error was that you forgot the bracket on line 1. While wait() do