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: Scripting help!

Previous Thread :: Next Thread 
MarcusDomitiusScipio is not online. MarcusDomitiusScipio
Joined: 11 Aug 2009
Total Posts: 331
16 Jan 2016 06:35 PM
Why doesn't this crap work..... ._.

ds = game:GetService("DataStoreService"):GetDataStore("VirtualCurrency")

game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("IntValue", player)
leaderstats.Name = "leaderstats"
local vc = Instance.new('IntValue', player)
vc.Name = 'VC'
vc.Value = ds:GetAsync(player.Name) or 0

end)

game.Players.PlayerRemoving:connect(function(player)
ds:UpdateAsync(player.Name, function(oldValue) return
player.leaderstats.VC.Value
end)

end)

game.OnClose = function()
for i, v in pairs(game.Players:GetChildren()) do
ds:UpdateAsync(v.Name, function(oldValue) return
v.leaderstats.VC.Value end)
end
wait(1)
end
Report Abuse
hkep is not online. hkep
Joined: 19 Jul 2014
Total Posts: 550
16 Jan 2016 06:49 PM
vc is put in the player rather than leaderstats.
Report Abuse
hkep is not online. hkep
Joined: 19 Jul 2014
Total Posts: 550
16 Jan 2016 06:50 PM
Visit my thread: http://forum.roblox.com/Forum/ShowPost.aspx?PostID=181749340
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