You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
A “welding” part that welds to other parts of specific names.
What is the issue? Include screenshots / videos if possible!
It doesnt work, but theres no errors.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Nothing, no.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
script.Parent.Touched:Connect(function(hit)
if hit.Name=="2x1x2" or "3x3x3 Ball" or "2x2x2" or "4x1x2" then
local w=Instance.new("WeldConstraint")
w.Part0=script.Parent
w.Part1=hit
end
if hit.Parent:FindFirstChild("Humanoid") then
return
end
end)
The script is above.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
He definitely means the weld constraint. Also, try this script.
script.Parent.Touched:Connect(function(hit)
if hit.Name=="2x1x2" or "3x3x3 Ball" or "2x2x2" or "4x1x2" then
local w=Instance.new("WeldConstraint")
w.Enabled=true
w.Part0=script.Parent
w.Part1=hit
w.Parent=script.Parent
end
if hit.Parent:FindFirstChild("Humanoid") then
return
end
end)
Small issue, it seems to be gluing itself to a part i used to spawn the bricks, it is welded to the head and the name is Place. I tried to use more conditions but nothing worked.
This should be the fix, if this doesn’t work then I have no idea
script.Parent.Touched:Connect(function(hit)
if hit.Name == "2x1x2" or hit.Name == "3x3x3 Ball" or hit.Name == "2x2x2" or hit.Name == "4x1x2" then
if hit.Parent:FindFirstChild("Humanoid") then
return
end
local w = Instance.new("WeldConstraint")
w.Enabled = true
w.Part0 = script.Parent
w.Part1 = hit
w.Parent = script.Parent
end
end)