I only want certain people to get into the admin menu. Help? It still lets everybody in.
local adminb = menu.Admin local adminmenu = script.Parent.AdminMenu function adminbc() --admin button if game.Players.LocalPlayer.Name == "Andorks" or "Player1" then adminmenu.Visible = true menu.Visible = false end end script.Parent.Menu.Admin.MouseButton1Click:connect(adminbc) --admin button
The problem is game.Players.LocalPlayer.Name == "Andorks" or "Player1"
The computer tries to simplify that into true or false, and can't. If you want to use that syntax, use the following code:
game.Players.LocalPlayer.Name == "Andorks" or game.Players.LocalPlayer.Name == "Player1"
Hence:
repeat wait() until game.Players.LocalPlayer; local adminb = menu.Admin local adminmenu = script.Parent.AdminMenu function adminbc() --admin button if game.Players.LocalPlayer.Name == "Andorks" or game.Players.LocalPlayer.Name == "Player1" then adminmenu.Visible = true menu.Visible = false end end script.Parent.Menu.Admin.MouseButton1Click:connect(adminbc) --admin button
Alternatively, you could put the admin names in a table and loop through it to see if the LocalPlayer's name matches any of the values in the table.
Understand that by clicking here.
repeat wait() until game.Players.LocalPlayer; local adminb = menu.Admin local adminmenu = script.Parent.AdminMenu local admins = {"Andorks","Player1","NlLES"} function adminbc() --admin button for index,Name in pairs(admins) do --Run the following chunk of code once for each value in the "admins" table if game.Players.LocalPlayer.Name == Name then adminmenu.Visible = true menu.Visible = false end end end script.Parent.Menu.Admin.MouseButton1Click:connect(adminbc) --admin button