How does this not work, please help

I’ve been working on this for 2 days now and nothing is working for me, someone please save me.

I’m trying to remake an old building game, just watch the video and you’ll understand the problem. -


The base part adapts the velocity of the water when a part is welded to them both. I’m trying to make a script that will delete the weld that is attached to the water.

The water has a bodyVelocity of 0, 0, -40

Here is a script I’ve already tried -

script.Parent.ChildAdded:Connect(function(c)
	wait(0)
	if c.Part0 == "Moving Part" then
		c:Destroy()
	end
end)

The server script is located inside the part that is being duplicated. The problem there is that 2 welds are added to the part after it is put in between the base and the water.

If anyone has ANYTHING, please help. I’ve been stuck on this for so long that I can feel my brain cells dying.

2 Likes

Shouldn’t the Part0 be an instance rather than a string? If you want to get the name of the Part, you can simply write

if c.Part0.Name == "Moving Part" then
1 Like

Probably related to the changes roblox has been pushing to how surfaces work.

It’s a hack, but you could lower the water surface 0.1 studs or something.

2 Likes

@nicemike40
how would I go about removing welds when they are created though?

Like @ijmod said, you’re comparing an instance to a string.

Unfortunately I’m not familiar enough with the new weld system to help you much beyond that.

I would bet, though, that there’s some setting or property that would disable welds on the water in general, but I’m not sure what that is in the new system. Tomorrow maybe I’ll experiment.

Good luck :slight_smile:

Also… how does your part placement tool work? If it uses MakeJoints, the wiki says:

Deprecated

SurfaceType based joining is deprecated, do not use MakeJoints for new projects. WeldConstraints and HingeConstraints should be used instead

1 Like

try to use

weld.Part1 = nil