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 6 years ago
Edited 6 years ago

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

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

2 answers

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

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

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

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:

local a = true

Workspace.BG.Lolol.Touched:Connect(function(hit) -- hit is not needed, if this is a local script then do local plr = game.Players.LocalPlayer
    if a then
        a = false
        script.Parent.Visible = true
        wait(60)
        script.Parent.Visible = false
        a = true -- so now it will become visible again
    end
end)

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 — 6y
0
Are you making it with Filtering Enabled? BlackOrange3343 2676 — 6y
0
Filtering? sebse456 13 — 6y
0
FE, I'm guessing not since you asked BlackOrange3343 2676 — 6y
View all comments (2 more)
0
Well, probably not. Do you think you can help now with more details? :D sebse456 13 — 6y
0
Repost I will BlackOrange3343 2676 — 6y
Ad
Log in to vote
-2
Answered by
Smach28 10
6 years ago

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

Workspace.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 — 6y
0
You don't need to use a capital C theCJarmy7 1293 — 6y

Answer this question