I am making a script that gives access to a GUI if their username matches one of my admins. We wanted to make it from scratch. We have something like this.
local allowed1 = "6kCrxzy"
local allowed2 = "alex23x42"
local allowed3 = "iiTheLastBacon"
local plr = game.Players.LocalPlayer
local name = plr.name
local gui = game.StarterGui.AdminPanel
if name == allowed1 or allowed2 == name or allowed3 == name then
gui.Visible = true
else
gui:Destroy()
end
I know how unsecure this is and how I should do this with a server side script and clone it from Replicated Storage and all that. I like local scripts and I am gonna stick with them. If you can help me, please tell me the best and most secure way to get a player's name, one that is hard to spoof. I know you can check the game.Players.LocalPlayer.Name or game.Players.LocalPlayer.Character.Name. but those can be easily spoofed with a exploiter changing the client values. Can anyone tell me how to get a players name, one that is a challenge to spoof. Thanks!

2 comments
use the server side..(?)
Create a table with an array of UserIds (do not use player usernames because they can change their username for 1000 R$) and loop if a particular number is similar to the player's UserId (FirewolfYT_751's method), and use ServerScriptService for server-side scripts.