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
 

DATASTORE PROBLEM

Previous Thread :: Next Thread 
DevDeadly3652 is not online. DevDeadly3652
Joined: 17 Nov 2011
Total Posts: 465
19 Oct 2015 05:11 PM
Problem: It is Only Loading One Value When i Load player.userId i thought thats how it works to load a value. my gut is telling me Change player.userId to the Value name
------------------------------------------------
local SacredStorage = game:GetService("DataStoreService"):GetDataStore("BleachOnlineReborn")
game.Players.PlayerAdded:connect(function(player)
local Level = Instance.new("IntValue")
Level.Name = "Level"
Level.Value = 1
local XP = Instance.new("IntValue")
XP.Name = "XP"
XP.Value = 0
local NEWBIE = Instance.new("BoolValue",player)
NEWBIE.Name = "NewPlayer"
NEWBIE.Value = false
local MaxXP = Instance.new("IntValue")
MaxXP.Name = "MaxXP"
MaxXP.Value = 5
MaxXP.Parent = player
Level.Parent = player
XP.Parent = player
if SacredStorage:GetAsync(player.userId) ~= nil then
XP.Value = SacredStorage:GetAsync(player.userId)--problem
Level.Value = SacredStorage:GetAsync(player.userId)---problem
MaxXP.Value = SacredStorage:GetAsync(player.userId)---problem
end
while true do
wait(2)
SacredStorage:SetAsync(player.userId,Level.Value,XP.Value,MaxXP.Value,NEWBIE.VALUE)
end
end)
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