Deathlios
(GigaChadzzBbx1)
March 21, 2021, 12:19pm
#1
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local RightHand = Character:WaitForChild("RightHand")
local Folder = Instance.new("Folder",Character)
Folder.Name = Player.Name.."'s Mjolnir"
local Mjolnir = WeaponFolder:WaitForChild("Mjolnir"):Clone()
Mjolnir.CFrame = RightHand.CFrame
Mjolnir.Parent = Folder
local Weld = Instance.new("Weld")
Weld.Part0 = Mjolnir
Weld.Part1 = RightHand
Weld.C0 = Weld.Part0.CFrame:ToObjectSpace(Weld.Part1.CFrame)
Weld.Parent = Weld.Part0
end)
end)
As you can see above I had every part designated to the right place, the part that I want to weld goes to part0 and the part I’m welding to goes to part1. However when I run the script and look at the weld’s properties under mjolnir in the explorer. Its part1 slot is empty, resulting in a broken weld, what’s the cause behind this? How do i fix it?
1 Like
Could you try adding print()
statements or change the Part1
again after a certain interval of time has passed?
1 Like
Deathlios
(GigaChadzzBbx1)
March 21, 2021, 3:33pm
#4
What exactly do you mean? change the part one to the same part again?
1 Like
Deathlios:
Weld.Parent = Weld.Part0
i think your parenting the weld on the Part0
Deathlios
(GigaChadzzBbx1)
March 21, 2021, 3:42pm
#6
I should be parenting it to part1 then?
parent the weld somewhere like a folder
Deathlios
(GigaChadzzBbx1)
March 21, 2021, 3:43pm
#8
Can i parent it to the weapon itself?
The parent doesn’t matter. I would say put Part0 as the more dominant part, in this case RightHand, but I’m not sure if that will fix anything.
try to see if it works 30 letters
Deathlios
(GigaChadzzBbx1)
March 21, 2021, 3:49pm
#11
@myaltaccountsthis was right, the parenting didn’t change anything. the issue i found is that this line
Deathlios:
Weld.Part1 = RightHand
doesn’t actually set part1 to my right hand and i have to manually do it myself in order for it to work which weird. This a studio bug?
try using WeldConstraint instead of Weld then CFrame your tool handle on RightHand
Deathlios
(GigaChadzzBbx1)
March 21, 2021, 3:52pm
#13
I’m not using a tool, just want to weld the damn part to my hand.
then weld the part and cframe it on ur hand
Deathlios
(GigaChadzzBbx1)
March 21, 2021, 3:54pm
#15
I did that in my code didn’t I?
i think this is the problem, you didnt set the Weld.C1 (i guess)
After a couple of seconds have passed inside that event, change the Weld.Part1
again or the Weld.C1