Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a GUI that when you hit a brick it appears, but after 60 seconds, it disappears?

Asked by 7 years ago
Edited 7 years ago

I've tried for atleast 20 minutes now and I'm stuck.

1Workspace.BG.Lolol.Touched:connect(function(hit)
2    script.Parent.Visible = true
3    wait(60)
4        script.Parent.Visible = false
5end)
0
what is the parent? is it the Parent the frame, GUI, or the textbox? ninja_eaglegamer 61 — 7y
0
Well the GUI is actually just a frame. A see-through frame that covers the hole screen. sebse456 13 — 7y
0
So the parent is the frame. sebse456 13 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago
1Workspace.BG.Lolol.Touched:connect(function(hit)
2    script.Parent.Visible = true
3    wait(60)
4        script.Parent.Visible = false
5end)

Your current script has many problems, and, we need more information.

Assuming from what you have as of now, you have either a BillboardGUI or SurfaceGUI.

To start off, I suggest using a capital c because a lower case is deprecated

1Workspace.BG.Lolol.Touched:Connect(function(hit)
2    script.Parent.Visible = true
3    wait(60)
4        script.Parent.Visible = false
5end)

now, we don't know what script this is, so, let's say "add a local script" (Local scripts work best when dealing with GUI)

There is no point of having "hit" since your not going to use it. Now I can help improve your code, but can not help you solve your problem. This is because information was lacking.

You can add a debounce so spam doesn't happen:

01local a = true
02 
03Workspace.BG.Lolol.Touched:Connect(function(hit) -- hit is not needed, if this is a local script then do local plr = game.Players.LocalPlayer
04    if a then
05        a = false
06        script.Parent.Visible = true
07        wait(60)
08        script.Parent.Visible = false
09        a = true -- so now it will become visible again
10    end
11end)

I can only help you to what I know and what should be done. I wish you luck on your goal.

0
Thanks :D It didn't work. But, I can tell you some infomation. It's a local script, and it's just a semi-transparent frame that needs to fill the whole frame. Also. The part is also semi-transparent and has no-collision on. sebse456 13 — 7y
0
Are you making it with Filtering Enabled? BlackOrange3343 2676 — 7y
0
Filtering? sebse456 13 — 7y
0
FE, I'm guessing not since you asked BlackOrange3343 2676 — 7y
View all comments (2 more)
0
Well, probably not. Do you think you can help now with more details? :D sebse456 13 — 7y
0
Repost I will BlackOrange3343 2676 — 7y
Ad
Log in to vote
-2
Answered by
Smach28 10
7 years ago

You need to put a capital C in Connect. so it will be like this

1Workspace.BG.Lolol.Touched:Connect(function(hit)

And ps: Just reminding you, if you want to affect one player only then put it in a local script.

0
I'f you have any problems or need additional help comment this, and if I helped you aprove it pls. Smach28 10 — 7y
0
You don't need to use a capital C theCJarmy7 1293 — 7y

Answer this question