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)
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.