The GUI doesn't become visible for some reason

Greetings,

Basically, the frame doesn’t open which is strange, please help! The code is down below.

--Services

local player = game:GetService("Players").LocalPlayer

--Events

--Items

local frame = script.Parent

player.CharacterAdded:Connect(function()
frame.Visible = true
frame.LocalScript:Destroy()
end)

Is this in a local script, or is it a server script

This is a local script, I really have to use a local sadly

Are you sure it’s the frame that is with visible off? (and not the ScreenGui)

Yes I’m 100% sure

char limit

You’re trying to wait for the player character to spawn once? or continuously have it play this script? Because, if you’re going to delete this script I think you just want the frame to show up once. So if that’s the case, you have to instead put this line up to replace that player.CharacterAdded, like so:

if not Character then repeat wait() until player.CharacterAppearanceLoaded:Wait() end
frame.Visible = true

It’s probably because the character spawns in before the script does, so it’s not firing the event of player.CharacterAdded.

1 Like

You can do this with a normal server script in scriptService

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function()
		player.PlayerGui.frame.Visible = true
	end)
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.