pivot513
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 328 |
|
|
| 22 Aug 2013 12:28 PM |
I have a game where you can choose what race you want when you first join it, and when you join it again It doesn't show. However, this GUI is still showing everytime I join.
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent:ClearAllChildren() SaveBoolean('Played', true) end)
game.Players.PlayerAdded:connect(function(p) WaitForDataReady() played = p:LoadBoolean('Played') if played == true then script.Parent.Parent.Parent:ClearAllChildren() end end)
--hierarchy: StarterGui -- ScreenGUI -- Frame -- ImageButton -- This Script
|
|
|
| Report Abuse |
|
|
| |
|
pivot513
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 328 |
|
|
| 22 Aug 2013 12:37 PM |
| I already put in PlayerAdded. |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 22 Aug 2013 12:40 PM |
| p:WaitForDataReady() try that |
|
|
| Report Abuse |
|
|
pivot513
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 328 |
|
| |
|
|
| 22 Aug 2013 12:43 PM |
| CharacterAdded works when the character respawns but I'm not sure what you are looking for so sorry. |
|
|
| Report Abuse |
|
|
pivot513
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 328 |
|
|
| 22 Aug 2013 12:52 PM |
Oh, I see, let me show with comments on each part to explain.
script.Parent.MouseButton1Click:connect(function() --Connects when the button is clicked on script.Parent.Parent.Parent:ClearAllChildren() --Deletes all children under "ScreenGUI" SaveBoolean('Played', true) --Saves the fact that the Player has played the game end)
game.Players.PlayerAdded:connect(function(p) --Connects when a player is added WaitForDataReady() --Waits for data to load played = p:LoadBoolean('Played') --Loads if the Player has played before if played == true then --If the player has played then script.Parent.Parent.Parent:ClearAllChildren() --Deletes all children under "ScreenGUI" end end) |
|
|
| Report Abuse |
|
|
pivot513
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 328 |
|
|
| 22 Aug 2013 01:13 PM |
| Bump. Please, I need help. |
|
|
| Report Abuse |
|
|