Hi, I am making a C4. Everything is done except for it to get stick to the walls/players. Well, when the C4 is touched, It should weld to the hit part, which it does, but gets back to where it was. It’s shown in the video:
https://streamable.com/xeyugd
Here’s my code:
local con;
con = newC4.Main.Touched:Connect(function(hit)
if not hit:IsDescendantOf(newC4) and not hit:IsDescendantOf(plr.Character) then
wait()
local WELD = Instance.new("WeldConstraint")
WELD.Part0 = newC4.Main
WELD.Part1 = hit
WELD.Parent = hit
con:Disconnect()
end
end)
Also, all the elements of C4 are welded to its main part. As you can see, it’s newC4.Main.Touched
.
I gave as much information as I could. Help is very appreciated!