local players = game:GetService("Players") local gui = game.ServerStorage.Name_stats local creatorsgui = game.ServerStorage.Creators local function createGui(player, character) local gc = gui:clone() local cgc = creatorsgui:clone() local name = player.Name local level = player.leaderstats.Level local cnames = {"duckyo01", "tonymayhem" , "Bluefeather2011", "Bladedevv", "Verassi", "Sourskittles"} while character do wait() if name == cnames then cgc.Parent = character.Head cgc.Nameandlevel.Text = "Creator | "..name.. "" else gc.Parent = character.Head gc.Nameandlevel.Text = "" ..name.. " | Level: "..level.Value.."" end end end players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) createGui(player, character) end) end)
Yes my main account name is duckyo01 so me typing my name wrong is not a reason.
There are several things you can do to fix this script. One thing you can do is implement your names as a set
. With a set, you can simply index the names to check if it is in the set, like so:
-- Convert your table into a set. You can probably write a function that does this for you... local cnames = { duckyo01 = true, tonymayhem = true, Bluefeather2011 = true, Bladedevv = true, Verassi = true, Sourskittles = true } ... if cnames[name] then -- will be true or nil, depending on whether or not it is in the set ...
You can also try iterating through the list of names. Although this is slower if you're working with a large list of names (probably not enough to actually matter, though.)
local cnames = {"duckyo01", "tonymayhem" , "Bluefeather2011", "Bladedevv", "Verassi", "Sourskittles"} ... local nameFound = false for _, cname in pairs(cnames) do -- check each name in cnames if cname == name then -- if we find the name we were looking for nameFound = true -- then set nameFound to true break end end if nameFound then -- did we find the name that we were looking for? ...