Sword Lining Issue

So I’m not sure how to fix this mess but this is what it does

Code:


local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local Model = Tool:WaitForChild("Model")

local Slash = script:WaitForChild("Slash")
local Debounce = false
local PlayersHit = {}

--Ads Welds--

for i, Parts in pairs(Model:GetChildren()) do
	
	if Parts:IsA("BasePart") then
		
		local Weld = Instance.new("WeldConstraint")
		Weld.Part0 = Parts
		Weld.Part1 = Handle
		Weld.Parent = Parts
	end
end

--Animate--

Tool.Activated:Connect(function()
	
	if Debounce == false then
		Debounce = true
		
		local Humanoid = Tool.Parent:WaitForChild("Humanoid")
		local AnimTrack = Humanoid:LoadAnimation(Slash)
		
		AnimTrack:Play()
		wait(1)
		Debounce = false
	end
end)

--Damage--

Handle.Touched:Connect(function(Hit)
	
	if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent ~= Tool.Parent then
		
		if Debounce == true and PlayersHit[Hit.Parent] == nil then
			
			Hit.Parent:FindFirstChild("Humanoid"):TakeDamage(25)
			
			PlayersHit[Hit.Parent] = true
			wait(1)
			PlayersHit[Hit.Parent] = nil
		end
	end
end)```

Are you using a tool?
if yes consider this
https://www.roblox.com/library/153352998/Tool-grip-editor

1 Like

Your Weld needs a C0 and C1 for proper alignment. Otherwise it will set the weld at the center of both Parts.

Yes it is a tool

(Character limit)

They seem to be using Weld Constraints which do not need C0 and C1. I’m assuming that the Tool grip editor would be the solution here.

WeldConstraints do have a C0 and C1 property. It’s automatically calculated when you select both items using the Constraint with the mouse.