I'm trying to use this to make a GUI appear every time a certain player respawns, but it doesn't work for some reason.
local Players = game:GetService("Players") local function onCharacterAdded(character) if character.Name == "Mexual" then game.Players.Mexual.PlayerGui:WaitForChild("OpEn").Frame.Visible = true else character.PlayerGui:WaitForChild("OpEn").Frame.Visible = false end end
im just going to put what the script i used in my game but here is the script
while true do if game.Players.LocalPlayer.Name == "Mexual" then wait() else script.Parent:Destroy() end end
the while true do
makes it so its always looking for the player
remember to put the local script in the startergui
You could just this inside a LocalScript inside of the ScreenGui
local Player = game.Players.LocalPlayer -- returns true or false local IsAdmin = Player.Name:lower() == 'mexual' local ScreenGui = script.Parent local Open = ScreenGui:WaitForChild('OpEn') local Frame = Open:WaitForChild('Frame') Frame.Visible = IsAdmin
You need to insert the following:
local gui = script.Parent gui.ResetOnSpawn = false if gui.Parent.Name == "PlayersName" then gui.TextLabel_orFrame_orScrollingFrame.Visible = true else gui.TextLabel_orFrame_orScrollingFrame.Visible = false end
Insert that into a LocalScript. (maybe script idk) But insert this into StarterGui in the game explorer