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: What do I use to make a gui appear only once?

Previous Thread :: Next Thread 
Fadeless is not online. 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 is not online. 22ron
Joined: 17 Jun 2012
Total Posts: 279
22 Aug 2014 09:35 PM
Use a PlayerAdded (Event)
Report Abuse
Vescatur is not online. 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 is not online. 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 is not online. 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 is not online. Fadeless
Joined: 02 Jun 2013
Total Posts: 2046
22 Aug 2014 09:49 PM
b1
Report Abuse
Cindering is not online. 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
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
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 is not online. Fadeless
Joined: 02 Jun 2013
Total Posts: 2046
22 Aug 2014 10:03 PM
Thanks!
Report Abuse
jonesj627 is not online. 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
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