How do I put and weld a part to a sword?

i tried to make it so that when I press q my sword glows and gets longer so what I did is I made a separate part and made a script that teleports it to the sword’s cframe then weld it. The problem is it doesn’t work. Can you guys check what’s wrong with my script? or what I can do to make my sword look longer and glow?

here’s a video of how it doesnt work and at the end how I wanted it to look like:

local script:

local character = game.Players.LocalPlayer.Character
local rp = game:GetService("ReplicatedStorage")
local excalibureffect = rp:WaitForChild("ExcaliburEffect"):Clone()
local excalibur = character:WaitForChild("excalibur")
local uis = game:GetService("UserInputService")
local debounce = false

uis.InputBegan:Connect(function(input,isTyping)
	if isTyping then 
		return
	elseif input.KeyCode == Enum.KeyCode.Q then
		if debounce == false then
			debounce = true 

			excalibureffect.Parent = game.Workspace
			excalibureffect.CFrame = excalibureffect.CFrame * CFrame.new(excalibur.Position)
			local weld = Instance.new("ManualWeld")
			weld.Part0 = excalibureffect
			weld.Part1 = excalibur
			weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
			
		end
	end
end)
1 Like