Assuming this is the whole script, you haven’t closed the PlayerAdded connection. Try this:
game.Players.PlayerAdded:Connect(function(player)
if player.Name == 'twichman123' then
-- Run Code
else
script.Parent:Destroy()
end
end)
Edit: It looks like this is being run in a server script as you are using PlayerAdded. You should be controlling UI from the client in a local script. For that, just use
Like @Increated said you can get the local player directly from the client side.
Also, if your admin system works by firing remotes from a gui then be sure to validate the player when the event is received on the server side. Always assume that any player can fire any remote with any arguments, regardless of whether they have the gui or not.
Using the PlayerAdded event on a local script isn’t necessary if the script is only for one player. game:GetService("Players").LocalPlayer gets the player who is currently running the local script.
So your script should look something like:
local player = game:GetService("Players").LocalPlayer
if (player.Name ~= "twichman123") then
script.Parent:Destroy()
end
You’re using PlayerAdded in a Service that is going to replicate its children to the client, i.e. the StarterGui. Due to this, the script would only fire when another player joins the server. To be honets, I doubt it would fire, as I’m not sure PlayerAdded works on the client side.
Delete that script, and put this code in a LocalScript.
(Not going to post, @Blokav already did it)