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

"object is not valid member of TextButton" error?

Asked by 7 years ago
Edited 7 years ago
script.Parent.MouseButton1Down:connect(function()
    script.Parent.Visible = false
    while wait() do
        local players = script.Parent.Parent.PlayerList
        players.LocalPlayer.object.Value = game.Players.LocalPlayer
        local tabl = players:GetChildren()
        local thing = {}
        for i, v in pairs(tabl) do
            local name = v.Name
            local check = string.sub(name,1,6)
            if check == "Player" then
                table.insert(thing, v)
            end
        end
        local playerz = game.Players:GetChildren()
        for i, v in pairs(playerz) do
            for a, b in pairs(thing) do
                b.object = v
            end
        end
    end
end)

there IS a child named object in b so idk why its not working, please help! line 18 https://gyazo.com/5b901ba2654c27e6a32d1b1e0123c66d

1 answer

Log in to vote
0
Answered by
GingeyLol 338 Moderation Voter
7 years ago

v is already defined in the for i, v in pairs(playerz) statement meaning that

b.object = v would do nothing

and the variable should be infront but its already defined earlier

Ad

Answer this question