Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this weld script working?

Asked by 8 years ago

This weld script wont keep the parts inside the tool together.

local Base = script.Parent.Handle
local Welds = {}

for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA("BasePart") then
local Weld = Instance.new("Weld", game.JointsService)
Weld.C1 = v.CFrame:toObjectSpace(Base.CFrame)
Weld.Part0 = Base
Weld.Part1 = v Welds[i] = Weld:Clone()
end
end

script.Parent.Equipped:connect(function(­)
for i, v in pairs(Welds) do
v:Clone()
end
end)

This error is in the output: Workspace.Lightsaber.Script:13: <name> or '...' expected near '­'

Answer this question