--[[
    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)

1 comment

1

Please make sure you're asking questions that benefit you, and help you better understand something. This isn't a request site, and you should not be asking "do the work for me" questions.