Connecting a model to a tool and tweening it's size

hey all, I have a weapon that spawns a beam, which is supposed to attach it’s attachment to the tool’s attachment, and tween its size to become larger, except it does not attach, just welds to the tool
script:

mastersparkEvent.OnServerEvent:Connect(function()
	local HakkeroBeam = ReplicatedStorage.BulletModels:WaitForChild("HakkeroBeam")
	local createBeam = HakkeroBeam:Clone()
	createBeam.Parent = workspace.Bullets
	for i, Parts in pairs(createBeam:GetChildren()) do
		if Parts:isA("BasePart") then
			local Weld = Instance.new("WeldConstraint")
			Weld.Part0 = Handle
			Weld.Part1 = Parts
			Weld.Parent = Parts
		end
		Parts.Anchored = false
		Parts.CanCollide = false
		Parts.Massless = true
	end
	createBeam.Field.AttachPoint.CFrame = Handle.BulletPoint.CFrame
	--local testsize = TweenService:Create(test,Info,Goals)
	--testsize:Play()
end)
1 Like

Hello @Secerne! I took your script and tried to solve your problem. Below, you can see what I did. I hope this is what you want.

mastersparkEvent.OnServerEvent:Connect(function()
    local HakkeroBeam = ReplicatedStorage.BulletModels:WaitForChild("HakkeroBeam")
    local createBeam = HakkeroBeam:Clone()
    createBeam.Parent = workspace.Bullets
    for i, Parts in pairs(createBeam:GetChildren()) do
        if Parts:IsA("BasePart") then
            local Weld = Instance.new("WeldConstraint")
            Weld.Part0 = Handle
            Weld.Part1 = Parts
            Weld.Parent = Parts
        end
        Parts.Anchored = false
        Parts.CanCollide = false
        Parts.Massless = true
    end
    createBeam.Field.AttachPoint.CFrame = Handle.BulletPoint.CFrame
    --local testsize = TweenService:Create(test,Info,Goals)
    --testsize:Play()
end)

:pencil2: Edit: The only difference is the isA to IsA. I am a newbie to scripting, but I think this is the error.
If you found this answer useful, do not forget to mark it as solved :white_check_mark:.

2 Likes

nah, that didnt change anything, cause i think isA is just deprecated of IsA or so

Well, buddy, I tried to help you. I am sorry for not being able to solve your problem. I am new to LUA scripting, so yeah, I am sorry.

You are welding it to tool tho.

well, i was welding it to the tool using a regular instance.new part and it was able to “attach” to the attachment point, so i assumed it would work for a model

heres a video of what i mean if it helps

I still need help, changing the CFrame to one of the parts in the model does absolutely nothing and removing the weld code just simply makes it not weld