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

GUI Background not going invisible?

Trying to make a GUI so that when you step on a brick, it says hiding and makes it go invisible, and step on another it says visible (and makes it re-appear), but when stepping on the brick to make it invisible, the text box goes invisible, but not the background? (The text re-appear's when I step on the one to make it visible.)

2 comments

0

And why haven't you posted the script you're using to do this?

0

Give us the script and we will fix it for u

1 answer

✓ Accepted answer

Not entirely sure what you are trying to accomplish, but I gave it my best shot.

I created two parts in Workspace, and inserted a Script into each (Not a Localscript).

HidingBrick/HidingScript:

wait(1)
local gui = game.Players.LocalPlayer.PlayerGui.Main.GUI


function onTouch(part) 
	print('HidingBrick Touched')
local humanoid = part.Parent:FindFirstChild("Humanoid") 
if (humanoid ~= nil) then -- if a humanoid exists, then 

gui.HidingLabel.Visible = true
wait(1)
gui.HidingLabel.Visible = false
gui.Visible = false
end 
end 

script.Parent.Touched:connect(onTouch)

VisibleBrick/VisibleScript:

wait(1)
local gui = game.Players.LocalPlayer.PlayerGui.Main.GUI


function onTouch(part) 
	print('HidingBrick Touched')
local humanoid = part.Parent:FindFirstChild("Humanoid") 
if (humanoid ~= nil) then -- if a humanoid exists, then 

gui.Visible = true
gui.VisibleLabel.Visible = true
wait(1)
gui.VisibleLabel.Visible = false


end 
end 

script.Parent.Touched:connect(onTouch)

I then created a "ScreenGui" object into "StarterGui". I named this "Main"

Under Main I created a "Frame" object, named, "GUI"

Under GUI, I created two TextLabels named, "HidingLabel" and "VisibleLabel". I set the text for HidingLabel to "Hiding". and VisibleLabel to "Visible". I then made both of these TextLabels not visible.

Works pretty well for me, but again.. not really sure if that is what you meant.

2 comments

0

Thank's alot dude! I'm amazed at how small the block of code was compared to mine. Heh. It worked amazingly. Thanks a bunch. I'll use this instead now. :D

0

My pleasure! I am sure there is a better way to do this (There always is), but I am glad that this worked for you. :)

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