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

idk how to fix this error local 'weld' (a nil value) its keeps showing up how do i fix?

Asked by 5 years ago

19:17:54.504 - Workspace.Script:10: attempt to index local 'weld' (a nil value)

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)


    for _,put in pairs(game.Workspace.Dummy:GetChildren()) do
        if put:IsA("BasePart") then

            local ip = put:Clone()
            wait(1)
                local weld Instance.new("Weld")
                weld.Part0 = ip
            ip.Parent = workspace




            for _,i in pairs(player.Character:GetChildren()) do

        if i:IsA("BasePart") then
            i.Transparency = 1
            local findpart = player.Character:FindFirstChild(ip.Name)
            if findpart then
                weld.Part1 = findpart
            end

        end
            end




        end
    end




end)

1 answer

Log in to vote
1
Answered by 5 years ago

Your local weld is missing a = sign. It's ment to be local weld = Instance.new("Weld")

0
thx Xd helleric -3 — 5y
Ad

Answer this question