ok so i am trying to make a admin gui which has nothing done except the login page so i am mostly looking help for searching through a whole array with a conditional statement im not fully sure how to do this I looked at the roblox wiki and that didnt help! Here is my code:
local LPlayer = game.Players.LocalPlayer local users = {"billybob","CharlieBrown","Player1"} -- for testing but Player1 is for studio local password = "NocTernL" --setting up shortcuts local loginpage = script.Parent.LoginPage -- part of the Gui function login() if users[LPlayer.Name] == nil then -- this is where i think the problem is LPlayer.Character.Humanoid.Health = 0 -- Just so u know this part was for testing it end end loginpage.login.MouseButton1Click:Connect(login) --just calling it
Thanks!
Either set your table up like
{ ["Name"] = true; ["Name2"] = true; }
to have it work with the code you have now, or loop through the table and look if the member is valid instead of the index:
for index,member in pairs(names) do -- index will be a number so you can't index by table[name] if member == name then return true