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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 30 Jul 2012 09:00 PM |
Not at all.
Looks like you know more about what I did anyways ;P |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 30 Jul 2012 09:04 PM |
If you're talking to me:
No? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 30 Jul 2012 09:18 PM |
| game.Lighting.GuiNameHere:clone().Parent = NewPlayer.PlayerGui |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 9233 |
|
|
| 30 Jul 2012 09:24 PM |
Wait, nvm.
I got this.
Thanks a bunch :P |
|
|
| Report Abuse |
|
|