So, I'm trying to make a script that when a player joins that is on the "whitelist" (called specials) a chat message shows up. --Shouldn't be too hard to explain @CailThePuppy
PROBLEM Nothing happens, nor does the things print
local specials = {"rexbit", "TheHospitalDev","Player","Player1"} game.Players.PlayerAdded:connect(function(player) print("Hola1") for x=1, #specials do print("Hola2") if specials[x] == player.Name then print("Hola3") game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ Text = "A special player has entered the game!"; Color = Color3.new(34/255,255/255,0/255); Font = Enum.Font.SourceSansBold; FontSize = Enum.FontSize.Size18; }) end end end)
That's quite an abstract way of checking a table but there's a lot simpler of a way using a for loop.
local specials = {"rexbit", "TheHospitalDev","etc"} game.Players.PlayerAdded:connect(function(player) for x=1, #specials do if specials[x] == player.Name then --code to run end end end)
Otherwise I'm not sure what you're asking.