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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 2873 |
|
|
| 07 Sep 2014 08:16 PM |
Thank you so much
undefined |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 2873 |
|
|
| 07 Sep 2014 08:25 PM |
Oh, there it is. Thanks man.
undefined |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 07 Sep 2014 08:41 PM |
"I added an additional 'end'"
any reason why?
did you expand the code posted above? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 07 Sep 2014 08:43 PM |
| oh sorry, just realized that |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 2873 |
|
| |
|