Help With Admin Panel

Hello Guys If You Can Help Me It Will Be Good :slight_smile:
So, When I Press The Open Gui Key (F4) The Console Prints That I’m Not Admin

This Is The Code (Server-Side):

And This Is The Code (Client-Side):

1 Like

make the userid a number instead of a string.

1 Like

u mean this?

local Admins = {
898780205,
151846846
}

1 Like

Yes, that is exactly what I meant.

Yes he means that, also make sure you actually send arguments through FireServer() if you have the being returned.

i tried that already but it wont work

An alternative way is nesting the userid conditional in a tostring()

I see the problem, make sure the UserId is not a string, and send the player through the arguments.

local player = game.Players.LocalPlayer
OpenGui:FireServer(player)

Why would you send the player as an argument in the remote event? The player is automatically received in OnServerEvent without the extra argument and would lead to it looking like this:

event.OnServerEvent:Connect(function(player, player)

You don’t need to pass the player argument when sending remote events to the server. But I would rather comment that you are not sending any parameters (aka the key parameter) that you are passing from the event emission.

OnServerEvent already knows the player who fired it so you shouldn’t send it

1 Like

haha, i forgot about that feature!

1 Like

Why are you even using a remote event you could do the same thing through the local script

That’s not really secure. Exploiters can just open the panel without any issues.

1 Like

Using a RemoteEvent is more secure, so is checking on the server. An exploiter could easily edit the LocalScript.

1 Like

You can’t edit local scripts per se but you can delete them.

wedge is right, the thread’s poster may as well not use a RemoteEvent instance as the ScreenGui is enabled from the client.

Also you wouldn’t want to call table.find on a player’s name, and then match it with a player’s UserIDs, so make sure all the values of the table are UserIDs, preferably integers.