Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --@author FiredDusk (aka Previized)
- --[[ NOTES:
- 1. Make sure in both parts, or all parts, "Archored" and "CanCollide" are false (unchecked)
- --]]
- local MainPart = script.Parent.Main -- The main part that holds the weld
- for i,Part in pairs(script.Parent:GetChildren()) do
- if Part:IsA('Part') or Part:IsA('WedgePart') or Part:IsA('UnionOperation') or Part:IsA('MeshPart') or Part:IsA('CornerWedgePart') or Part:IsA('TrussPart') or Part:IsA('NegateOperation') then
- local Weld = Instance.new('Weld',MainPart)
- Weld.C0 = MainPart.CFrame:toObjectSpace(Part.CFrame)
- Weld.Part0 = MainPart
- Weld.Part1 = Part
- end
- end function onTouch(part)
- local humanoid = part.Parent:FindFirstChild("Humanoid")
- if (humanoid ~= nil) then -- if a humanoid exists, then
- humanoid.Health = 0 -- damage the humanoid
- end
- end
- script.Parent.Touched:connect(onTouch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement