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

Why isnt the Spectate Gui working, how do I solve the problem?

Asked by 5 years ago

So I dont want a whole code(If you do, thanks) but how would i make it possible to only spectate players in a table?

Here is my table code (In normal script) ((Spectate Gui is normaly in a seperate local script, isnt it? How would I do that? Because i cant acces the table from my normal script on the localscript, can I?))

activecontestants = {}

    for _, player in pairs(contestants) do
            if player then
                local character = player.Character
                if character then
                    local humanoid = character:FindFirstChild("Humanoid")
                    if humanoid and humanoid.Health > 0 then
                        if player ~= Gamemaker then
                        table.insert(activecontestants, player)
                    end
                end
            end
        end
    end

So how would I get to only spectate the players who are in this table? I looked up the internet and there is no good tutorial for this to do it right. They all just get all players in game.

I tried many ways and still fail. I tried to put a string in the players who are in the Table and search for the string, but i failed.

Please, please help meeh, my brain starts to hurt..

0
Any errors? MaximumOverdriven 152 — 5y
0
On this particular part of the code, no. Paintertable 171 — 5y
0
I assume contestants is the table the function Players:GetPlayers returns saSlol2436 716 — 5y
0
yes. and then they will be put in the table activecontestants. Paintertable 171 — 5y

Answer this question