Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with value loading data store?

Asked by 8 years ago
Edited 8 years ago

Well I have a datastore setup the issue is when I print out the health value it comes out as 50 not 100 and the saves isn't working when I changed the value. So like if I join in the game again when I changed the value it will come out as 50 so that means if it came out as 0 it should of been 100 not 50... Code:

01--[[
02    Hunger,Thirst,Health
03--]]
04wait()
05local Data = game:GetService("DataStoreService")
06local HungerValue = Data:GetDataStore("8432345EKF")
07local ThirstValue = Data:GetDataStore("83924355KJ")
08local HealthValue = Data:GetDataStore("38533456KD")
09name = "PurelyMystic"
10pls = game.Players:GetUserIdFromNameAsync(name)
11print(HealthValue:GetAsync(pls))
12game.Players.PlayerAdded:connect(function(plr)
13    print("Joined")
14    local folder = Instance.new("Folder", plr)
15    local hunger = Instance.new("IntValue", folder)
View all 31 lines...
1
Pls put your cod is a code block User#5423 17 — 8y

1 answer

Log in to vote
-1
Answered by 8 years ago

for line 22 to 24 try SetAsync

Ad

Answer this question