So I am trying to make a script where if the player who joins' name is a certain name, it makes a StarterGui in the player's PlayerGui delete. Here's what I have:
game.Players.PlayerAdded:Connect(function(plr) if plr.Name ~= "I_vNextLevel" then plr.PlayerGui.Epic:Destroy() end end)
(Epic is the name of the StarterGui)
What you would wanna do is use both userids and some more... Finding things. Heres an example that would work for you (Place either in the GUI or in PlayerScripts as a local script)
local Plr = game.Players.LocalPlayer local PlayerGui = Plr:WaitForChild("PlayerGui") local Gui = PlayerGui:WaitForChild("Epic") if Plr.UserId ~= 29572815 then --Replace the Id with your Id Gui.ResetOnSpawn = false Gui.Enabled = false end
It's best not to destroy as it will just come back if they die unless by default it doesnt have reset on spawn. Just put protection into the scripts inside it so exploiters don't make use of it.