|
| 06 Jan 2012 05:19 AM |
I'm working on a game, and one of the features is at the beginning, when a picture shows up at the start, then six seconds later, it vanishes. Funny thing is, when I click the play button while in the studio, it works the way I wanted it to, but if I Play Solo it, the picture just stays up and never goes away. The scripting is: ----- game.StarterGui.ScreenGui.Frame.Visible = true
wait (6)
print 'disabled' game.StarterGui.ScreenGui.Frame.Visible = false ----- Another GUI use that I have going is to inform the player that he/she can't go a certain way because that is out of bounds. When I put that in, however, that never showed up when I Play Solo. Scripting goes: ----- function onTouched(hit)
print 'Touch' game.StarterGui.OutOfBounds.Frame.Visible = true
wait (3)
print 'Warned' game.StarterGui.OutOfBounds.Frame.Visible = false
end
script.Parent.Touched:connect(onTouched) -----
The prints show up in my output when the appropriate action is taken, but no GUI. The layout of both GUI's goes as follows: StarterGui>ScreenGui>Frame>ImageLabel (Starting image) StarterGui>OutOfBounds (ScreenGui, just renamed)>Frame>ImageLabel (Out of Bounds)
I know I'm doing something wrong, but I can't figure out what. Any idea on what to do? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 06 Jan 2012 10:59 AM |
| Do you mean changing ScreenGui to PlayerGui?? |
|
|
| Report Abuse |
|
|
Kepie
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 884 |
|
|
| 06 Jan 2012 11:04 AM |
| @marble ScreenGui have to be when you should make a GUI xD. |
|
|
| Report Abuse |
|
|
| |
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 06 Jan 2012 11:21 AM |
Marbles you make no sense.
Instead of ScreenGui it needs to be the PlayerGui, because the PlayerGui is for the player that the GUI is inside. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 11:24 AM |
| I am not a great scripter. A lot of the stuff I'm doing now is for practice. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 11:27 AM |
How in the name of god can you change ScreenGui into PlayerGui. That makes no sence at all.
So I'll break it down a little bit easier so everyone understands it.
StarterGui puts a gui in every player that respawns's PlayerGui. Everything that's changed in startergui will only take effect when a player has respawned. Everyting that's changed in the PLAYERGUI will instantly take effect in the player whose playergui was used.
Example :
I respawn i get gui1. Then I set gui1 to gui2 IN STARTERGUI. I respawn, i get gui2
Example2 : I respawn, i get gui1 Then I set gui1 to gui2 IN PLAYERGUI. I instantly get gui2. |
|
|
| Report Abuse |
|
|