Hello can someone help me with this script my friend gave me? its a weld script, that when you touch the part it welds to your torso. But it only works when you touch it can someone help me do it when someone connects to the game? thanks.
I'm really new to lua and just needed that script to test out my gui i made.
script.Parent.Touched:connect(function(hit)
humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid then
head = hit.Parent.Torso
script.Parent.CFrame = head.CFrame * CFrame.new(-0.8,1,-0.0008)
weld = Instance.new ("Weld")
weld.Part0 = head
weld.C0 = head.CFrame:inverse()
weld.Part1 = script.Parent
weld.C1 = script.Parent.CFrame:inverse()
weld.Parent = script.Parent
script.Parent.Anchored = false
end
end)

1 comment
Thank you so much dude you help me alot ;)