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: "If it's their first time" script

Previous Thread :: Next Thread 
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
30 Jul 2012 08:38 PM
I want to make a script that activates only the first time a player visits your place. After that, they can visit it again and again and it won't activate again unless they play it on a different account.

I know this should involve some SaveString commands, which I'm not good with....

How would I do this?
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
30 Jul 2012 08:55 PM
I'm not good with savestring, but have a Boolean in the player, that saves on exit, but if it's their first time, it should be true, and once they leave for the first time, it should change to "false".
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
30 Jul 2012 08:56 PM
I never bothered to learn how to properly user data persistence, so this wont be much help.


game.Players.PlayerAdded:connect(function(player)

player:WaitForDataReady()
local Check = LoadBoolean("Played")

if Check == false then
--First time they have entered
elseif Check == true then
--They have been here before
end

if player.DataReady then
player:SaveBoolean('Played', true)
end

end)


It's quite literally stuff I just pulled of the wiki. Might give you an idea where to go though.
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
30 Jul 2012 08:58 PM
Most of us didn't I guess.
But yes, let me explain what WhoBloxedWho did.
player:WaitForDataReady() --Use this while your using Data Persistence.
local Check = LoadBoolean("Played") <--Boolean.

if Check == false then
--First time they have entered
elseif Check == true then <-----What I said earlier
--They have been here before
end


if player.DataReady then <--Checking if ready data
player:SaveBoolean('Played', true) <--- Saves.
end

end)
--------
WhoBloxedWho, I hope you don't mind.
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
30 Jul 2012 09:00 PM
Not at all.

Looks like you know more about what I did anyways ;P
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jul 2012 09:01 PM
game.Players.PlayerAdded:connect(function(NewPlayer)
NewPlayer:WaitForDataReady()
local HasBeenHereBefore = NewPlayer:LoadBoolean("HasBeen")
if not HasBeenHereBefore then
--Do stuff
NewPlayer:SaveBoolean("HasBeen", true)
end
end)
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
30 Jul 2012 09:03 PM
Would I have to put a CustomCharacterStatus into the player for that to work though?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jul 2012 09:04 PM
If you're talking to me:

No?
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
30 Jul 2012 09:17 PM
Well thanks guys.


One more thing:

I'm sorry if this borders into request territory, but I want the player to recieve a GUI (from Lighting) when the script fires. Could someone please tell me how to do that? .-.
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
30 Jul 2012 09:18 PM
game.Lighting.GuiNameHere:clone().Parent = NewPlayer.PlayerGui
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
30 Jul 2012 09:20 PM
Thanks a bunch.

Also, just one, *one* last thing about the first script you gave me.

Do I need to make the HasBeen boolean myself or is it completely edit-free, save the "do stuff" part?
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
30 Jul 2012 09:24 PM
Wait, nvm.

I got this.

Thanks a bunch :P
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