Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can someone help me with my weld script? The problem is that it breaks.

so when I hold my tool it works just fine with the weld script. But when buy the tool from the shop the weld breaks and it scatters everywhere. Plz help me.

my weld script:

local prev 
local parts = script.Parent:GetChildren() 

for i = 1,#parts do 
	if (parts[i].className == "Part" or parts[i].className == "UnionOperation") then 
		if (prev ~= nil)then 
			local weld = Instance.new("Weld") 
			weld.Part0 = prev 
			weld.Part1 = parts[i] 
			weld.C0 = prev.CFrame:inverse() 
			weld.C1 = parts[i].CFrame:inverse() 
			weld.Parent = prev 
		end 
		prev = parts[i] 
	end 
end

my shop script:

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Down:Connect(function()
	if player.leaderstats.Cash.Value >= 60 then 
		player.leaderstats.Cash.Value = player.leaderstats.Cash.value - 10
		game.ReplicatedStorage.Weapons.SithSaber:Clone().Parent = player:WaitForChild("Backpack")
	end
end)

4 comments

0

Please validly use the code block as I cannot help you at all with your script all messed up like this.

0

ok

0

does this help?

1

So I'd assume that your cloning the tool on the client and the weld script is a server script so it won't run

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.