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: Help!

Previous Thread :: Next Thread 
masterfire113 is not online. masterfire113
Joined: 01 Nov 2009
Total Posts: 125
17 Jul 2014 10:59 PM
I cannot get this data store script to work. "mapNumb" is an IntValue inside of starterpack. PLEASE HELP ME, MY SANITY IS AT RISK RIGHT NOW.


game.Players.PlayerRemoving:connect(function(player)
local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")
player:WaitForDataReady()
wait(2)
mapDist = player.Backpack:FindFirstChild("mapNumb").Value
dataStore:SetAsync(player.Name, mapDist)
end)

game.Players.PlayerAdded:connect(function(player)
local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")
repeat wait() until player.Character
player:waitForDataReady()
wait(2)
player.Backpack.mapNumb.Value = datastore:GetAsync(player.Name)
if player.Backpack.mapNumb.Value == 0 then
player.Backpack.mapNumb.Value =1
end
blocks = Instance.new("NumberValue", Workspace)
blocks.Value = 20
blocks.Parent = player
blocks.Name = "blocksLeft"
blocks2 = Instance.new("NumberValue", Workspace)
blocks2.Value = 33
blocks2.Parent = player
blocks2.Name = "bloocksLeft"
gameGui = game.Lighting.gameGui:Clone()
gameGui.Parent = player.PlayerGui
wait(2)
end)

Report Abuse
masterfire113 is not online. masterfire113
Joined: 01 Nov 2009
Total Posts: 125
17 Jul 2014 11:09 PM
dangit, i know people are seeing this

someone help already
Report Abuse
pa00 is not online. pa00
Joined: 06 Jun 2010
Total Posts: 451
17 Jul 2014 11:23 PM
local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")

By doing this you are making a unique datastore for every single player, every time a new player connects.

Just make your DataStore something like "Stats"

local datastore = game:GetService("DataStoreService"):GetDataStore("Stats")
Report Abuse
masterfire113 is not online. masterfire113
Joined: 01 Nov 2009
Total Posts: 125
18 Jul 2014 12:16 AM
Still does not work.
Report Abuse
HGuitar is not online. HGuitar
Joined: 08 Sep 2011
Total Posts: 106
18 Jul 2014 12:34 AM
I think you may have lost your sanity already with what your wearing. Seriously, what were you thinking when you u bought that???
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