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

How do I make a popup gui by touching a brick?

I want to make a GUI popup when a player touches a specific brick.

I'm finding a lot of trouble with the positioning of the GUI frames but that is not what I need help with. When the player touches the brick, a text will popup on the screen for (3) seconds, and then disappear.

I remember trying to do this without help but did not succeed and the GUI just doesn't pop up, I removed the script shortly after because I could not find the reason why it did not work so I can't paste it in here.

The player is not allowed to skip the text and will have to wait for the GUI to disappear in the (3) seconds.

I hope that my explanation is clear enough and that I am not confusing anyone, just in case more explanation is needed, please use the comments section and I'll try to answer as fast as possible! Any help is very appreciated.

2 answers

✓ Accepted answer

(insert something funny here)

hi lemme help

You want to use remote events.

To start of, create a RemoteEvent in ReplicatedStorage, make sure to name it: "PopupGuiEvent"

Now lets get into scripting it!

First of, inside the part, make a server script and insert the following code into it!

If this helped you, please mark this as the answer!

Server Script

local event = game:GetService("ReplicatedStorage"):WaitForChild("PopupGuiEvent")

script.Parent.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

	if plr then
		event:FireClient(plr)
	end
end)

Now make a local script inside StarterGui, and then insert the following code into it.

Local Script

local event = game:GetService("ReplicatedStorage"):WaitForChild("PopupGuiEvent")
local gui = script.Parent.PopupGui.Frame
local db = false


event.OnClientEvent:Connect(function()
	if not db then -- If db is false, the script will run the next bits of code
		gui.Visible = true
		db = true
	
		wait(3)
		
		gui.Visible = false
		db = false
	end
end)

13 comments

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

testing if i fixed a problem with my scriptinghelpers page

0

Hey, this did not work for me and I'm not sure if I did it right. I am so thankful for using your time, to make a script for me aswell, I'm not sure if I got this part right though, should I name the Frame or the Screengui that has the frame in it?

0

Name the screengui  "PopupGui", im about to edit the script to work.

0

Thanks

You can do this either two ways: Both ways require you to use a bricks touch event. Mind the lack of code. I'm on my phone so I can't write well. Second method is more complicated but it's good for doing more advanced things to the gui.

Method #1

  1. Create a touch event that does the following:
  2. get the players gui inside the player

(Not sure where it is off the top of my head but you can see it's location when you press play and look at the players in the explorer.)

  1. Next, change the guis visible property to true

  2. Wait(3)

  3. Make the gui's visible to false.

Method #2

  1. Create a touch event that does the following:

  2. Fire a remote event called showGui

  3. In a local script inside the gui, have a function that runs when the remote event is fired:

  4. Inside the function make the gui visible

  5. Wait(3)

  6. Make it invisible again

21 comments

0

OOF, i just posted a answer lol

0

OOF, i just posted a answer lol

0

uhh, why are there two comments

0

uhh, why are there two comments

0

uhh, why are there two comments

0

uhh, why are there two comments

0

uhh, why are there two comments

0

uhh, why are there two comments

0

uhh, why are there two comments

0

HELP

0

HELP

0

HELP

0

HELP

0

HELP

0

HELP

0

HELP

0

It's gucci u have code so that's nicer I can't get on my computer to write code sadly.

0

HELP

0

Wtf

0

what is happening

0

/shrug

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