✓ Accepted answer
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()
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)
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()
for index,Name in pairs(admins) do
if game.Players.LocalPlayer.Name == Name then
adminmenu.Visible = true
menu.Visible = false
end
end
end
script.Parent.Menu.Admin.MouseButton1Click:connect(adminbc)
3 comments
If my answer is correct, please hit accept answer.
Okay, let me try it out. Thanks!
@Andorks Alright, let me know how it goes!