my friend needs help with this datastore? [closed]
--[[
Hunger,Thirst,Health
--]]
wait()
local Data = game:GetService("DataStoreService")
local HungerValue = Data:GetDataStore("8432345EKF")
local ThirstValue = Data:GetDataStore("83924355KJ")
local HealthValue = Data:GetDataStore("38533456KD")
name = "PurelyMystic"
pls = game.Players:GetUserIdFromNameAsync(name)
print(HealthValue:GetAsync(pls))
game.Players.PlayerAdded:connect(function(plr)
print("Joined")
local folder = Instance.new("Folder", plr)
local hunger = Instance.new("IntValue", folder)
local thirst = Instance.new("IntValue", folder)
local health = Instance.new("IntValue", folder)
folder.Name = "Stats"
hunger.Name = "Hunger"
thirst.Name = "Thirst"
health.Name = "Health"
hunger.Value = HungerValue:GetAsync(plr.userId) or 100
thirst.Value = ThirstValue:GetAsync(plr.userId) or 100
health.Value = HealthValue:GetAsync(plr.userId) or 100
end)
game.Players.PlayerRemoving:connect(function(plr)
local stat = plr.Stats
HungerValue:SetAsync(plr.userId, stat.Hunger.Value)
ThirstValue:SetAsync(plr.userId, stat.Thirst.Value)
HealthValue:SetAsync(plr.userId, stat.Health.Value)
end)
Closed as Not Constructive by ScriptGuider and User#6546
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?