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: Anyway to "Save" players?

Previous Thread :: Next Thread 
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
07 May 2014 08:21 PM
I wanna sort of save the names of players who enter my game? Would that be possible?
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
07 May 2014 08:22 PM
Yes.

You could use an ordered data store to count their visits. I would have no problem making that for you if you want.
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
07 May 2014 08:25 PM
That would be great o.o Can you do it? I'm not good with data stuff.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
07 May 2014 08:28 PM
How do you want it? Top 10 Most Visits per Visitor, or just save the times they visited on a leaderboard, both, or/and just save their names?
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
07 May 2014 08:29 PM
Just the names and how many times they visited. That would be GREAT. :D
Report Abuse
RevolutionXPK is not online. RevolutionXPK
Joined: 28 Oct 2011
Total Posts: 785
07 May 2014 08:33 PM
im looking for same thing too, a who visited and how much leaderboard
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
07 May 2014 08:45 PM
try this and let me know if it fails

local ds = game:GetService("DataStoreService"):GetDataStore("visits")

function n(player)
player:WaitForDataReady()

local save = player.Name

local ls, visits = Instance.new("IntValue", player), Instance.new("IntValue", ls)
ls.Name, visits.Name = "leaderstats", "Visits"

-- Their names are in the data store, and the times visited is if they are in game

-- I can do a global leaderboard though

if ds:GetAsync(save) ~= nil then
visits.Value = ds:GetAsync(save)
else
visits.Value = 0
wait(2.5)

ds:IncrementAsync(save, 1)
end
end

game.Players.PlayerAdded:connect(n)
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
07 May 2014 08:55 PM
Didn't work....
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
07 May 2014 09:01 PM
Jimmy has the right idea though.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
07 May 2014 09:01 PM
replace DataStoreService with ServerStorage
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
07 May 2014 09:09 PM
This one works if you put it inside a script in Workspace, do not modify it before you test it out.

-- @ JimmyChance

local store = game:GetService("DataStoreService"):GetOrderedDataStore("Visited")

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

player:WaitForDataReady()

local ls = Instance.new("IntValue", player)
ls.Name = "leaderstats"

local visits = Instance.new("IntValue", ls)
visits.Name = "Visits" -- pl0x

local k = player.Name.." visits"

if store:GetAsync(k) ~= nil then
visits.Value = store:GetAsync(k)
else
visits.Value = 0
end

store:IncrementAsync(k, 1)
end)
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
07 May 2014 09:11 PM
Jimmy, you look like a good scripter. Can you fix this? D:

http://www.roblox.com/Forum/ShowPost.aspx?PostID=133011500
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
07 May 2014 09:18 PM
Jimmy, that one didn't work either. :P
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
07 May 2014 10:08 PM
Yes it does, you are doing something that is messing it up then.
Report Abuse
TxOreo1 is not online. TxOreo1
Joined: 13 Apr 2014
Total Posts: 34
07 May 2014 10:32 PM
Strangest thing

Jimmy

Chance

WHite boy name

Black avatar

Can code, wtf since when black ppl code
Report Abuse
IntelligentBeing is not online. IntelligentBeing
Joined: 11 Jul 2013
Total Posts: 523
08 May 2014 02:52 PM
._. Trying to be racist? I know a lot of BLACK people who can program. I know white people who can program too. There isn't much of a difference other than the color. They can both program. It's not that rare. -.-
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
08 May 2014 03:03 PM
brb i am going to create a free model
Report Abuse
1234Christopher is not online. 1234Christopher
Joined: 21 Oct 2008
Total Posts: 1715
08 May 2014 03:17 PM
Can someone help make a leaderboard for a score?
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
08 May 2014 03:26 PM
local ods = game:GetService("DataStoreService"):GetOrderedDataStore("Visits")


game.Players.PlayerAdded:connect(function(p)
    if not ods:GetAsync(p.userId.."Visits")then ods:SetAsync(p.userId.."Visits")end
    wait(1)
    ods:UpdateAsync(p.userId.."Visits",function(old)return old+1 end)
end)

this have to be in workspace and will count visits(you just have to create a gui that will show all those )
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