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

Why will this check the playgui? [SOLVED]

local player = game.Players.LocalPlayer

if game.Workspace.Battle.Value == true then 
	player:WaitForChild("PlayerGui").Header.Text.Visible = false 
	for i,v in pairs(player:WaitForChild("PlayerGui").Main:GetChildren()) do
	    if v:IsA("GuiObject") then
	        v.Visible = true
	    end
	end
end

when I start a 2 player server it dosent make the visibilty to them change

3 comments

0

Can you edit your post and go into a bit more detail? Do you mean each object's children or the object itself?

0

Well all I really want is to just want the header.text visigble = false and the mains children visible = true, but it dosent work, I have even tried game.StarterGui.Header.Text.Visible = false and even that dosent work

0

Don't use game.StarterGui, you have to use the player's PlayerGui.

1 answer

✓ Accepted answer

Put this in a Local Script inside StarterGui.

local player = game.Players.LocalPlayer

player:WaitForChild("PlayerGui").Header.Text.Visible = false --Make the Text object in Header invisible.
for i,v in pairs(player:WaitForChild("PlayerGui").Main:GetChildren()) do --Gets all children in the Main gui in the player's PlayerGui.
	if v:IsA("GuiObject") then --If the child is a Gui Object then
		v.Visible = true --Make the child visible.
	end
end

2 comments

0

dosent work, ive editted my answer

0

and it is in local and in startergui

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