Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 22 Aug 2014 09:33 PM |
And by that, I mean appearing once and that's it.
Once the player has joined, they will receive a gui. How would I start off, or make it so it would only appear once, and stop showing for that user? |
|
|
| Report Abuse |
|
|
22ron
|
  |
| Joined: 17 Jun 2012 |
| Total Posts: 279 |
|
| |
|
Vescatur
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 3426 |
|
|
| 22 Aug 2014 09:35 PM |
game.Players.PlayerAdded:connect(function(plr) script.GuiYouWantCloned:clone().Parent = plr.PlayerGui end) |
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 22 Aug 2014 09:35 PM |
game.Players.PlayerAdded:connect(function(plr) wait() if plr then local gui = script.GUINAME:clone() gui.Parent = plr.PlayerGui end end)
Put the script in workspace, and the Gui in the script. When the player joins and only that time will it give them the GUI. |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
|
| 22 Aug 2014 09:36 PM |
I already know about those.
I'm saying, so the gui won't appear for the player when moving to different servers.
If it's DataStore, how would I start it? |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
Cindering
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 8171 |
|
|
| 22 Aug 2014 09:57 PM |
| You would use GetAsync() to try to load a key from the DataStore specific to that player's ID. If GetAsync() returns nil (which means the player has never visited the place before, so there is no data yet) then you would assign a value to that key and clone the starting GUI that you want. Then since their data is no longer nil, the GUI would never be cloned again for that player. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2014 09:58 PM |
Uhm, Create a Value.. Make the server check the Players Value when they join If the players value = 0 then give them the gui and change the value to 1 and save
Then the next time the player joins the value will be 1 so the player won't get the gui again
- I think this might work - |
|
|
| Report Abuse |
|
|
Fadeless
|
  |
| Joined: 02 Jun 2013 |
| Total Posts: 2046 |
|
| |
|
jonesj627
|
  |
| Joined: 06 Oct 2010 |
| Total Posts: 1496 |
|
|
| 22 Aug 2014 10:03 PM |
game.Players.PlayerAdded:connect(function(plr) local played = false local pb = game:GetService("DataStoreService"):GetDataStore("PlayedBefore") key = plr.userId played = pb if pb == false or pb == nil then print'he hasn't played before' pb:UpdateAsync(key, function(ov) local nv = true return nv end) end) else print'he's played before' end end)
i think this will work |
|
|
| Report Abuse |
|
|