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 » Scripters
Home Search
 

Re: DataStore Question.

Previous Thread :: Next Thread 
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
28 Mar 2016 10:19 PM
Can you save like 5 values to one datastore or do u need more then one...

local DSservice = game:GetService("DataStoreService")

local DataStore = DSservice:GetDataStore("SimpleSave")--im talking these

game.Players.PlayerAdded:connect(function(player)
local YourAPro = DataStore:GetAsync(tostring(player.UserId))
if YourAPro then
print(player.Name..' Is back for seconds ~ '..player.UserId)
print(YourAPro)
else
print(player.Name..' Is in for a big surprise')
DataStore:SetAsync(tostring(player.UserId),'-User')
end
end)
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
28 Mar 2016 10:21 PM
tables.
Report Abuse
c9_io is not online. c9_io
Joined: 15 Feb 2014
Total Posts: 2642
28 Mar 2016 10:24 PM
Off topic but I like your desc I'll just input all my trig equations here he he hehe
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
28 Mar 2016 10:27 PM
@Flat well this is my full* script: (How would I save all of these..?)



local DSservice = game:GetService("DataStoreService")
local DataStore = DSservice:GetDataStore("SimpleSave")
game.Players.PlayerAdded:connect(function(player)
local YourAPro = DataStore:GetAsync(tostring(player.UserId))
if YourAPro then
print(player.Name..' Is back for seconds ~ '..player.UserId)
print(YourAPro)
else
print(player.Name..' Is in for a big surprise')
DataStore:SetAsync(tostring(player.UserId),'-User')
end

local top = Instance.new("Folder", game:GetService('ServerStorage'))
top.Name = player.Name..player.userId

local stats = Instance.new("IntValue", top)
stats.Name = "leaderstats"

local no = Instance.new("Folder", top)
no.Name = "Settings"

local yo = Instance.new("IntValue", no)--hello, done
yo.Name = "Speed"

local yoo = Instance.new("IntValue", no)--hello, don
yoo.Name = "Health"

local ypp = Instance.new("IntValue", no)--hello
ypp.Name = "PresetSpeed"

local yp = Instance.new("IntValue", no)--hello
yp.Name = "PresetHealth"

local Points = Instance.new("IntValue" , stats) -- done
Points.Name = "Points"

local rk = Instance.new("IntValue" , stats) -- done
rk.Name = "Rank"

local xp = Instance.new("IntValue" , stats) --done
xp.Name = "Experience"

local nerd = Instance.new("IntValue" , player) --fake sht ehhh
nerd.Name = "leaderstats"

local nerd1 = Instance.new("IntValue" , nerd) --fake sht ehhh
nerd1.Name = "Lvl"

local nerd2 = Instance.new("IntValue" , nerd) --fake sht ehhh
nerd2.Name = "Exp"

local nerd3 = Instance.new("IntValue" , nerd) --fake sht ehhh
nerd3.Name = "Gold"
end)
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
28 Mar 2016 10:29 PM
*All homework automated in 5 minutes*
das it mane.
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
28 Mar 2016 10:30 PM
@Flat well this is my full* script: (How would I save all of these..?)
---
just add all the values to a table and save it.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
28 Mar 2016 10:32 PM
Im asking for a EXAMPLE.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
28 Mar 2016 10:59 PM
Well after saving is, how can I set the values when they rejoin..?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
28 Mar 2016 11:02 PM
example:
local tab = {12, 144, 90, 20};
local ds = game:GetService("DataStoreService"):GetGlobalDataStore();
ds:SaveAsync("example_save", tab)

Loading it you'd just get the save and go through the list in order of how you saved it then setting the IntValues based on what you got from the array.
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
28 Mar 2016 11:40 PM
http://www.roblox.com/item.aspx?id=388933292



Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
28 Mar 2016 11:53 PM
How is it 'Anti-Exploitable'..?
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
28 Mar 2016 11:54 PM
Meaning people can't go in and edit their values in the table.


Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
29 Mar 2016 12:08 AM
Oh lol, that's how mine works.
Report Abuse
spinywind is online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
29 Mar 2016 12:19 AM
Because all exploits are client sided and the stats are stored in server storage.



Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
29 Mar 2016 12:20 AM
^ I know, that's what I do.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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