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
 

Help please! This wont work.

Previous Thread :: Next Thread 
Demolite_STM is not online. Demolite_STM
Joined: 03 Feb 2017
Total Posts: 77
21 Oct 2017 04:42 PM
Hi! I have a saving script for my pets to see if the player has a pet. I resetted all the data by changing the key from "id-"..plr.UserId to "userId-"..plr.UserId to make sure that I didn't have the data I had ###o####### ###seems whenever I join the game the BoolValue just turns to true. I don't know why. Here's the script:

local DSService = game:GetService("DataStoreService"):GetDataStore("STMProd")
game.Players.PlayerAdded:connect(function(player)
local key = "userIdValue-"..player.userId
local folder = Instance.new("Folder",player)
folder.Name = "Pets"
local hasNeonPet = Instance.new("BoolValue",folder)
hasNeonPet.Name = "hasNeonPet"
hasNeonPet.Value = false

--------------------Saving Data ---------------------

local save = DSService:GetAsync(key)
if save then
hasNeonPet.Value = save[1]
else
local saveValue = {hasNeonPet.Value}
DSService:SetAsync(key, saveValue)
end
end)

game.Players.PlayerRemoving:connect(function(plr)
local key = "userIdValue-"..plr.userId
local saves = {plr.Pets.hasNeonPet.Value}
DSService:SetAsync(key, saves)
end)


Thanks for any help ;)
Report Abuse
Demolite_STM is not online. Demolite_STM
Joined: 03 Feb 2017
Total Posts: 77
21 Oct 2017 04:43 PM
The hashtags are just saying something like "so it didn't have the data I saved before."
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