Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

GUi showing does not work?

this is a simple question, why doesnt this script work..its so when a player joins the textlabel waits 1 second b4 showing

function Playerjoin()
	wait(1)
	script.Parent.Visible = true
end
script.Parent.Parent.Parent.Parent.Parent.Players.PlayerAdded:connect(Playerjoin) --heirachy is script<textlabel<Frame<ScreenGui<starterGui<game... then i go down..>Players>PlayerAdded

3 answers

Instead of:

script.Parent.Parent.Parent.Parent.Parent.Players.PlayerAdded:connect(Playerjoin) 

Why not just:

game.Players.PlayerAdded:connect(Playerjoin)
function MakeVisible(gui, bool)
	if bool == true then -- checks if you want it to be visible or not
		gui.Visible = true -- Makes the gui visible
	elseif bool == false then  -- checks if you want it to be visible or not
		gui.Visible = false -- Makes the gui invisible
	else -- if something went wrong then it will tell you
		error("Please make sure you have enetered a correct boolen must be a true or false")
	end
end

game.Players.PlayerAdded:connect(function(player) -- checks if a player is added
	repeat wait() until player.Character -- another way of waiting for the player's data
	MakeVisible(script.Parent, true) -- true if you want it to show, false if you want it to hide
end)
function MV(gui, bool)
	if bool == true then
		gui.Visible = true
	elseif bool == false then
		gui.Visible = false
	end
end

game.Players.PlayerAdded:connect(MV)function(player)
	repeat wait() until game.Players.PlayerAdded
	MV(script.Parent, true)
end)

did not copy I just learned the same way fire did.

1 comment

0

why wouldn't my way work though?

This discussion is preserved as it was. New answers, comments, and votes are closed.