Welds not working no matter what I do

Hello everyone! Hope you are having a nice day/night!

I have a problem. A problem with Welds and WeldConstraints.

I looked up some topics and watched some videos showing how to make welds properly but those didn’t help.

The thing is like this: I’m making a fighting game, made fists, when the player presses left click a localscript fires an event to a serverscript and that serverscript is supposed to clone a hitscan part, teleport it in front of the player’s head, parent it to the head and weld the hitscan part and the head together. But it just doesn’t want to!
As far as I know, the problem is not with the script.

This “bug” also happens with manually made welds. I just create a weld or a weldconstraint, run the game and the welds just evaporate! I also used Moon Animator’s Easy Weld plugin but that didn’t work neither. The welds just disappear when I run the game…

A section of the fists code should be down below:

tool.Equipped:Connect(function()
	print("equipped")
	local hum = char.Humanoid
	script.Parent.hold.Value = 0
	event:FireClient(player, "fist", "enable")


	mouseevent.OnServerEvent:Connect(function(plr, button)
		
		if button == "1down" then
			
			hold.Value = "0"
			
			while tonumber(hold.Value) ~= 1 do
				
				hold.Value = tostring(hold.Value + 0.1)
				wait(0.1)	

			end
	
		elseif button == "1up" then
			
			if tonumber(hold.Value) <= 0.3 then
				print("jab")
				hold.Value = "0"
				local hitscan = script.Parent.hitscan:Clone()
				hitscan.Parent = char.Head
				hitscan.hitscanscript.Disabled = false
				dmgevent:Fire(tonumber(hold.Value))
				hitscan.Size = Vector3.new(4,3,2)
				hitscan.Position = char.Head.Position + Vector3.new(-1.536, -0,761, 0)
--this is probably one of the weld lines where we wanna focus to
				local weld = Instance.new("WeldConstraint", hitscan)
				weld.Part0 = char.Head
				weld.Part1 = hitscan
				hold.Value = "0"
			else
				print("charge")
				local hitscan = script.Parent.hitscan:Clone()
				hitscan.Parent = char.Head
				hitscan.hitscanscript.Disabled = false
				dmgevent:Fire(tonumber(hold.Value))
				hitscan.Size = Vector3.new(4,3,2)
				hitscan.Position = char.Head.Position + Vector3.new(-1.536, -0,761, 0)
--another weld here
				local weld = Instance.new("WeldConstraint", hitscan)
				weld.Part0 = char.Head
				weld.Part1 = hitscan
				hold.Value = "0"

			end
			
		end
		
	end)

end)

Most of the prints work, the charge system also works but as I said, the welds does not. Any help would be really appreciated.

Sincerely, Egg.

1 Like

still no response… please, anyone?

Another script may be deleting the welds, are there any character anti-cheats which counter physics-based exploits? or even some kind of animation/ragdoll script which may interact with them?

1 Like

I don’t think there are any malware in the game, but yes I do have a ragdoll script I got from the toolbox (since im not that good of a scripter) but I don’t think that actually can mess with the welds since it’s local… Not sure though, it might be the case. I’ll try to disable it and update status when I’m back.

Try disabling it and test your script, to see if it’s causing the issue.

Yep! It was the ragdoll script. Thanks a lot!

1 Like