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

using table.concat and it won't show up on gui?

Asked by
7_c 37
5 years ago

Okay, so earlier today I was experimenting with this game I was making, but there's this line of code that doesn't work. It basically gathers the usernames of people who touched this part, and then places it in a table. But it won't show up on this Gui's text. It just says " won. " Here is the code that doesn't work. (even when i print it it shows up)

    local function falsepressed(player)
    if enabled == true then
    if game.Players:GetPlayerFromCharacter(player.Parent)then
    if checktable(nametable, player.Parent.Name) ~= true then
    print("Testing testing Testing 1 2 3")
    table.insert(nametable, player.Parent.Name)
    print(table.concat(nametable, ', '.." won."))   
    end
    end
    end
    end
    pgui:FindFirstChild("GameGui").Intermission.Text = "The answer was " ..answer
    wait(1)
    player.Character.Humanoid.Health = 0
    truepart.Touched:connect(truepressed)
    falsepart.Touched:connect(falsepressed)
    pgui:FindFirstChild("GameGui").Intermission.Text = table.concat(nametable, ' , ') .." won."-- problem here
0
It would be very helpful to everyone looking at your code and yourself if you would indent your code. Indenting your code makes it easier to read and helps show errors before they even happen. User#21908 42 — 5y

Answer this question