generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I NEED HELP WITH A POP UP GUI onTouch()

Previous Thread :: Next Thread 
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:09 PM
How would I make this (Still learning Lua)

undefined
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
07 Sep 2014 08:13 PM
It is a bit complicated for someone who is learning but. The basic part of it is, you do a function of it for onTouch and then change the transparency of the gui...
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
07 Sep 2014 08:13 PM
The gui has to be in startergui and make visible false
put this script inside the brick

script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.StarterGui.NAMEOFYOURGUI.Visible = true
end)
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:16 PM
Thank you so much

undefined
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
07 Sep 2014 08:22 PM
My mind feels stupid today

script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.NAMEOFYOURGUI.Visible = true
end)
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:25 PM
Oh, there it is. Thanks man.

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:26 PM
Would the Gui disappear after a certain ammount of time or does that require additional code?

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:38 PM
I added an additional 'end'

No bugs now but it still seems to not be working no matter the gui, I'm still messing with it.

undefined
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
07 Sep 2014 08:40 PM
you could add a wait() before the end and then change the visible property back to invisible after the wait
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
07 Sep 2014 08:41 PM
"I added an additional 'end'"

any reason why?

did you expand the code posted above?
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:42 PM
No there was two functions in the script therefore it needed two ends

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:43 PM
I'll take your advice but I'll have to make a test game because its not working


undefined
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
07 Sep 2014 08:43 PM
script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.NAMEOFYOURGUI.Visible = true
wait() --put how many seconds or decimals of a second you want the GUI to stay up for
plr.PlayerGui.NAMEOFYOURGUI.Visible = false
end)
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
07 Sep 2014 08:43 PM
oh sorry, just realized that
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 08:49 PM
Np, it still will not display the gui that's in starter gui. ;-;

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 09:01 PM
Ugh this is impossible I need this gui to pop up whe nI touch the brick ;-;

undefined
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
07 Sep 2014 09:02 PM
just noticed

script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.NAMEOFYOURGUI.Visible = true
end
end)


plr.PlayerGui.NAMEOFYOURGUI.Visible = true
assuming you have your gui in a ScreenGui, screengui doesn't have the property of Visible.

you need to go one more down the tree and into the frame(or whatever you have it called)

example;
AD3e8GB


-----------
script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.ScreenGui.Frame.Visible = true
end
end)

^^ works
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 09:07 PM
Ok ill work with that, thanks so much.

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 09:11 PM
YES! You were right! I wrote

script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.ScreenGui.ImageLabel.Visible = true
end
end)

And it executed perfectly! Thank you so much!

undefined
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 09:13 PM
And then of course

wait(4)
plr.PlayerGui.ScreenGui.ImageLabel.Visible = false

undefined
Report Abuse
PuNiShEr5665 is not online. PuNiShEr5665
Joined: 12 Aug 2009
Total Posts: 33713
07 Sep 2014 09:14 PM
no problem :)
I'm assuming you can figure out how to make it disapeer after a few seconds but here it is anyway



script.Parent.Touched:connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.ScreenGui.ImageLabel.Visible = true
wait(4)
plr.PlayerGui.ScreenGui.ImageLabel.Visible = false
end
end)



lol
Report Abuse
Krozome is not online. Krozome
Joined: 23 Nov 2012
Total Posts: 2873
07 Sep 2014 09:31 PM
yahp

undefined
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image