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

Name only gui help?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

So I have this script, and if your name is one of the names inserted, you can view a gui, if not then you cant view it. Can anyone help me?

local People = {"NotSoNorm","VisualGraphics"}
local P = game.Players.LocalPlayer

function Check(name)
    for i = 1, #People do
        if (string.upper(name) == string.upper(People[i])) then --Works with lower, hm haven't tested.
            return true
            else
            return false
        end
    end
end

while wait() do
    if (Check(P.Name)) then
    script.Parent.SergantCommand.Visible=true
    else
    script.Parent.SergantCommand.Visible=false
    end
end

1 answer

Log in to vote
3
Answered by 10 years ago

Your first line is wrong, the double quotes should go around one name and then another double quotes for the next name, so like this:

local People = {"NotSoNorm", "VisualGraphics"}

because the way you have it, the table is treating "NotSoNorm, VisualGraphics" as one whole name not individual names

0
I see where you are coming from, And that is correct. But there is another problem. But thanks for fixing that line. c: NotSoNorm 777 — 10y
Ad

Answer this question