Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

If I want to make a weld function, would this work?

What I want it to do is when it touches a brick named Baseplate It'll weld itself to it.

Part = workspace.Part

function weldontouch(hit)
	if hit.Name == "Baseplate" then
		Glue = Instance.new("Weld", Part)
		Glue.Part0 = Part
		Glue.Part1 = hit
	end
end
	
script.Parent.Touched:connect(weldontouch)

1 answer

Put this script in baseplate, so whatever touches it, will weld itself to baseplate.

function onTouched(sadf)

local Glue = Instance.new("Weld")
Glue.Parent = script.Parent
Glue.Part0 = w1.Parent
Glue.Part1 = sadf
Glue.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0, 0)
end 

script.Parent.Touched:connect(onTouched)

I also tried your script. It didn't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.