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

GUI Not Showing?

So i recently took some help from others to create a "url bar" in my computer, here's the code.

--- Configuration ---
plr = game.Players.LocalPlayer
comp = plr.PlayerGui.NNet
notice = comp.Notice

-- Domains --
youtube = comp.Websites.YouTube
roblox = comp.Websites.Roblox
twitter = comp.Websites.Twitter

-- Code --
comp.MainFrame.UrlBar.FocusLost:connect(function()
    input = comp.MainFrame.UrlBar.Text
if input == "youtube.rbx" or input == "www.youtube.rbx" or input == "http://youtube.rbx" then
	youtube.Visible = true
	notice.Visible = true
	notice:TweenPosition(UDim2.new(0, 100,0, 300), "Out", "Quad")
	wait(4)
	notice:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad")
	wait(2)
	notice.Visible = false
elseif input == "roblox.rbx" or input == "www.roblox.rbx" or input == "http://roblox.rbx" then
	roblox.Visible = true
	notice.Visible = true
	notice:TweenPosition(UDim2.new(0, 100,0, 300), "Out", "Quad")
	wait(4)
	notice:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad")
	wait(2)
	notice.Visible = false
elseif input == "twitter.rbx" or input == "www.twitter.rbx" or input == "http://twitter.rbx" then
	twitter.Visible = true
	notice.Visible = true
	notice:TweenPosition(UDim2.new(0, 100,0, 300), "Out", "Quad")
	wait(2)
	notice:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad")
	wait(2)
	notice.Visible = false
else
	comp.MainFrame.UrlBar.Visible = false
	comp.MainFrame.UrlError.Visible = true
	comp.Websites.YouTube.Visible = false
	comp.MainFrame.UrlError.Text = "ERROR: Url Not Found!"
	wait(4)
	comp.MainFrame.UrlError.Visible = false
	comp.MainFrame.UrlBar.Visible = true
	end
end)

Here's my problem,

The script works in Solo Mode but wont work in a server (clicking play out of studio), so i am trying to figure out why that is... There are no errors, i've tried if statements for all of them, it works either way.

So if you could please help me with trying to figure out why my gui doesn't work in an actual server

=============

New Errors (5/17/2014)

13:50:54.356 - Notice is not a valid member of ScreenGui
13:50:54.357 - Script 'Players.Player1.PlayerGui.NNet.MainFrame.UrlBar.DomainCheck', Line 4
13:50:54.357 - Stack End

BUT! Notice is a valid member.

Screenshot: puu.sh/8Q9iW.png

1 answer

I setup a quick gui, of what was in the gui-picture you uploaded.

Classic case of ROBLOX being too slow to load guis, or.. rather Local Scripts running before the Guis have loaded.

Here you go.

--- Configuration ---
plr = game.Players.LocalPlayer
comp = plr.PlayerGui.NNet
repeat wait() until comp:FindFirstChild("Notice")
notice = comp.Notice

-- Domains --
youtube = comp.Websites.YouTube
roblox = comp.Websites.Roblox
twitter = comp.Websites.Twitter

-- Code --
comp.MainFrame.UrlBar.FocusLost:connect(function()
    input = comp.MainFrame.UrlBar.Text
if input == "youtube.rbx" or input == "www.youtube.rbx" or input == "http://youtube.rbx" then
    youtube.Visible = true
    notice.Visible = true
    notice:TweenPosition(UDim2.new(0, 100,0, 300), "Out", "Quad")
    wait(4)
    notice:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad")
    wait(2)
    notice.Visible = false
elseif input == "roblox.rbx" or input == "www.roblox.rbx" or input == "http://roblox.rbx" then
    roblox.Visible = true
    notice.Visible = true
    notice:TweenPosition(UDim2.new(0, 100,0, 300), "Out", "Quad")
    wait(4)
    notice:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad")
    wait(2)
    notice.Visible = false
elseif input == "twitter.rbx" or input == "www.twitter.rbx" or input == "http://twitter.rbx" then
    twitter.Visible = true
    notice.Visible = true
    notice:TweenPosition(UDim2.new(0, 100,0, 300), "Out", "Quad")
    wait(2)
    notice:TweenPosition(UDim2.new(0, 0,0, 0), "Out", "Quad")
    wait(2)
    notice.Visible = false
else
    comp.MainFrame.UrlBar.Visible = false
    comp.MainFrame.UrlError.Visible = true
    comp.Websites.YouTube.Visible = false
    comp.MainFrame.UrlError.Text = "ERROR: Url Not Found!"
    wait(4)
    comp.MainFrame.UrlError.Visible = false
    comp.MainFrame.UrlBar.Visible = true
    end
end)

14 comments

0

Yes on both, i've tried print, it works, but the gui still doesn't show while in a real server..

0

In server, press Alt-F9. It'll show the output from the Server and your Client. Perhaps there's a problem when a server is started

0

Ok thanks, shall do.

0

Editing my post with new errors

0

At the beggining of the script, add this:   repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.PlayerGui:FindFirstChild("NNet")

0

No still same error...Could this just be a ROBLOX error?

0

Add a long wait time, see if still bugs out. Because sometimes LocalScripts load BEFORE the Player and stuff loads.      Either that, or add another repeat wait() until comp:FindfirstChild("Notice")

0

It's tell it's coming from LINE 4 - Where notices = comp.Notices

0

Yes it says it's not a member of ScreenGui (NNet), or hasn't loaded yet. This happens a lot, and usually a Wait fixes it.

0

I've tried both things you suggested. Nothing.

0

Any ideas?

0

Last test, put DomainChecker at the route of the Gui (NNet).

0

That worked, why was it doing that?!

0

Not sure, the DomainChecker had loaded before the gui, and just couldn't find the paths. Atleast it's fixed now.

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