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

GUI covers other GUI's?

This script creates a screengui that covers the whole screen. It's black. I've made this happen below but I want it to cover other GUI's in the startergui. I can see the blackscreen created by this script below and I can see other GUI's as well. I tried using the blackscreen.Zindex thing to make it black everywhere but it doesn't work. The bottom script works but still shows other GUI's.

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
if player.Name == "Precisionly" or player.Name == "UndecidedFate" then
local playergui = player:WaitForChild("PlayerGui")
local new = Instance.new("ScreenGui", playergui)
local blackscreen = Instance.new("Frame", new)
blackscreen.Size = UDim2.new(0, 10000, 0, 10000)
blackscreen.BackgroundColor3 = Color3.new(0, 0, 0)
blackscreen.Name = "BlackScreen"
end 
end)
end)

Now when I add blackscreen.Zindex = 10 to hide the other GUI's, the game completely becomes useless and doesn't work.

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
if player.Name == "Precisionly" or player.Name == "UndecidedFate" then
local playergui = player:WaitForChild("PlayerGui")
local new = Instance.new("ScreenGui", playergui)
local blackscreen = Instance.new("Frame", new)
blackscreen.Zindex = 10
blackscreen.Size = UDim2.new(0, 10000, 0, 10000)
blackscreen.BackgroundColor3 = Color3.new(0, 0, 0)
blackscreen.Name = "BlackScreen"
end 
end)
end)

1 answer

✓ Accepted answer

It's ZIndex, not Zindex

Lua is very case sensitive. Capitalize the I as well as the Z in ZIndex and you should be golden.

So your script should look like this,

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)
		if player.Name == "Precisionly" or player.Name == "xOmqCamila" then
			local playergui = player:WaitForChild("PlayerGui")
			local new = Instance.new("ScreenGui", playergui)
			local blackscreen = Instance.new("Frame", new)
			blackscreen.ZIndex = 10--capitalize the I
			blackscreen.Size = UDim2.new(0, 10000, 0, 10000)
			blackscreen.BackgroundColor3 = Color3.new(0, 0, 0)
			blackscreen.Name = "BlackScreen"
		end 
	end)
end

Good Luck!

2 comments

0

The GUI created didn't cover up the rest of them. Do you know what's wrong?

0

Not from the information that you provided. That was the only thing wrong with the script you provided that I could see. I'm assuming that fixed the error then? Maybe you should make sure that the other GUIs are not parented to the frame, and that the other GUIs have a lower ZIndex. But good luck.

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