I want to make it when the player joins it checks his username and if it is the right username it opens a GUI
I’ve tried changing where the script is located at but nothing, also this is a localscript
Here is where the script is located, already tried changing it to starterpack, startercharacterscript but nothing work, Maybe it is the code but I don’t see anything wrong with it.
task.wait(2)
local PlayerS = game:GetService("Players")
PlayerS.PlayerAdded:Connect(function(player)
if player.Name == "GuipaGG" then
player.PlayerGui:WaitForChild("OwnerPrompt").OpenCommands.Visible = true
print("Admin Joined")
else
print("Player is not admin.")
end
end)
Here you can see that the ScreenGui is enabled, the code and that is placed at the playerscripts.