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: Help with data store

Previous Thread :: Next Thread 
ReaperEVO is online. ReaperEVO
Joined: 24 Nov 2016
Total Posts: 54
04 Mar 2017 05:32 PM
so im baffled at why this script wont save 'cash'

here's the scripts
DSS = #########################################################

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

local uniquekey = plr.UserId
local stats = Instance.new('IntValue')
stats.Name = 'leaderstats'
stats.Parent = plr
local cash = Instance.new('IntValue')
cash.Name = 'Cash'
cash.Parent = stats
local GetSaved = DSService:GetAsync(uniquekey)

if GetSaved then
cash.Value = GetSaved[1]
else
local NumbersForSaving = {cash.Value}
DSService:SetAsync(uniquekey, NumbersForSaving)
print('set')
end
end)

game.Players.PlayerRemoving:connect(function(plr)
local uniquekey = plr.UserId
local Savetable = {plr.leaderstats.Cash.Value}
DSService:SetAsync(uniquekey, Savetable)
end)
Report Abuse
ReaperEVO is online. ReaperEVO
Joined: 24 Nov 2016
Total Posts: 54
04 Mar 2017 05:49 PM
bump
Report Abuse
Pete735 is not online. Pete735
Joined: 30 Sep 2012
Total Posts: 133
04 Mar 2017 06:18 PM
DSService is not defined. Change DSS on the top to DSService.


Report Abuse
ReaperEVO is online. ReaperEVO
Joined: 24 Nov 2016
Total Posts: 54
04 Mar 2017 06:20 PM
it is Roblox just hashtagged it out
Report Abuse
Pete735 is not online. Pete735
Joined: 30 Sep 2012
Total Posts: 133
04 Mar 2017 06:24 PM
Are you trying the script in studio? That could be the problem.

1. Go onto your place page that you're editing right now
2. Click the 3 bar icon at the top right area
3. Configure Game
4. Make sure "Enable Studio Access to API Services:" is checked.


Report Abuse
ReaperEVO is online. ReaperEVO
Joined: 24 Nov 2016
Total Posts: 54
04 Mar 2017 06:32 PM
Yeah thats enabled

also i have multiple places so i dont know if thats the problem. i dont think so because i tested it on another game and i still doesnt work
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