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: DataStore Y U NO WORK ლ(ಠ益ಠლ)

Previous Thread :: Next Thread 
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
30 Jul 2014 09:19 PM

local datastore = game:GetService("DataStoreService"):GetDataStore("DataStore")

function PlayerEntered(player)
repeat wait() until player.Character

local stats = Instance.new("IntValue")
stats.Parent = player
stats.Name = "leaderstats"

local shells = Instance.new("IntValue")
shells.Parent = stats
shells.Name = "Shells"

if datastore:GetAsync("Points_"..player.Name) ~= nil then
shells.Value = datastore:GetAsync(player.Name)
else
shells.Value = 0
end

shells.Changed:connect(function(Val)
datastore:SetAsync("Points "..player.Name, Val)
end)

if player.Name == "BruceAB12" or player.Name == "Player1" or player.Name == "HTC569" or player.Name == "daniel1016" then
player.leaderstats.Shells.Value = player.leaderstats.Shells.Value + math.random(10,20)
end
end

game.Players.PlayerAdded:connect(PlayerEntered)

No output. The value doesn't save :/
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
30 Jul 2014 09:26 PM
bump
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
30 Jul 2014 10:09 PM
bump
Report Abuse
BruceAB12 is not online. BruceAB12
Joined: 19 Jan 2012
Total Posts: 3238
30 Jul 2014 10:18 PM
I fixed it thanks for the help
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