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
 

need help with short script

Previous Thread :: Next Thread 
JoeyOrTiger is not online. JoeyOrTiger
Joined: 29 Jun 2009
Total Posts: 641
25 Feb 2016 07:37 PM
data = game:GetService('DataStoreService'):GetDataStore('datast0re')

game.Players.PlayerAdded:connect(function(p)
local hidden = Instance.new("Model", p)
hidden.Name = "hiddenstats"
local Points = Instance.new('StringValue', hidden)
Points.Name = "Points"
key = 'usertest_'..p.userId

if data:GetAsync(key) ~= nil then
Points.Value = data:GetAsync(key)[4]
end
end)

--- above works, only this part is broken ----
game.Players.PlayerRemoving:connect(function(p)
key = 'usertest_'..p.userId
local save = {p.hiddenstats.Points.Value}
data:SetAsync(key[4], save)
end)


please help I beg u
Report Abuse
Mxiko is not online. Mxiko
Joined: 20 Apr 2012
Total Posts: 74
25 Feb 2016 07:41 PM
p.leaderstats.Points:SaveNumber()



Report Abuse
JoeyOrTiger is not online. JoeyOrTiger
Joined: 29 Jun 2009
Total Posts: 641
25 Feb 2016 07:46 PM
no dude what the fudge thats data persistent

i only want datastore so plz help
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
25 Feb 2016 07:53 PM
local save = {}
save[4] = p.hiddenstats.Points.Value
data:SetAsync(key, save)


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