Thanks and i will:
This the other codes that can possibly influence this
local Points1 = DataStore:GetDataStore(“Points001”)
game.Players.PlayerAdded:Connect(function(Plr)
local stats = Instance.new(“Folder”, Plr)
stats.Name = “Stats”
— Level System
local Level = Instance.new(“NumberValue”, stats)
Level.Name = “Level”
Level.Value = 1
local Exp = Instance.new("NumberValue", stats)
Exp.Name = "Exp"
Exp.Value = 0
--- Money System
local Yen = Instance.new("IntValue", stats)
Yen.Name = "Yen"
Yen.Value = 0
--- Stats System
local Points = Instance.new("NumberValue", stats)
Points.Name = "Points"
Points.Value = 0
local MaxHealth = Instance.new("IntValue", stats)
MaxHealth.Name = "MaxHealth"
MaxHealth.Value = 100
local Stamina = Instance.new("IntValue", stats)
Stamina.Name = "Stamina"
Stamina.Value = 0
local Strength = Instance.new("IntValue", stats)
Strength.Name = "Strength"
Strength.Value = 0
---- Datastore ----
— Levels
Level.Value = Level1:GetAsync(Plr.UserId) or Level.Value
Level1:SetAsync(Plr.UserId, Level.Value)
–Level.Changed:connect(function()
– Level1:SetAsync(Plr.UserId, Level.Value)
–end)
— Yen
Yen.Value = Yen1:GetAsync(Plr.UserId) or Yen.Value
Yen1:SetAsync(Plr.UserId, Yen.Value)
– Yen.Changed:connect(function()
– Yen1:SetAsync(Plr.UserId, Yen.Value)
– end)
— Exp
Exp.Value = Exp1:GetAsync(Plr.UserId) or Exp.Value
Exp1:SetAsync(Plr.UserId, Exp.Value)
– Exp.Changed:connect(function()
– Exp1:SetAsync(Plr.UserId, Exp.Value)
– end)
Strength.Value = Strength1:GetAsync(Plr.UserId) or Strength.Value
Strength1:SetAsync(Plr.UserId, Strength.Value)
– Strength.Changed:connect(function()
– Strength1:SetAsync(Plr.UserId, Strength.Value)
– end)
— Health
MaxHealth.Value = MaxHealth1:GetAsync(Plr.UserId) or MaxHealth.Value
MaxHealth1:SetAsync(Plr.UserId, MaxHealth.Value)
– MaxHealth.Changed:connect(function()
– MaxHealth1:SetAsync(Plr.UserId, MaxHealth.Value)
–end)
— Stamina
Stamina.Value = Stamina1:GetAsync(Plr.UserId) or Stamina.Value
Stamina1:SetAsync(Plr.UserId, Stamina.Value)
– Stamina.Changed:connect(function()
– Stamina1:SetAsync(Plr.UserId, Stamina.Value)
– end)
— Points
Points.Value = Points1:GetAsync(Plr.UserId) or Points.Value
Points1:SetAsync(Plr.UserId, Points.Value)
–Points.Changed:connect(function()
–Points1:SetAsync(Plr.UserId, Points.Value)
end)
game.Players.PlayerRemoving:connect(function(Player)
Level1:SetAsync(Player.UserId, Player.Stats.Level.Value)
Yen1:SetAsync(Player.UserId, Player.Stats.Yen.Value)
Exp1:SetAsync(Player.UserId, Player.Stats.Exp.Value)
Strength1:SetAsync(Player.UserId, Player.Stats.Strength.Value)
MaxHealth1:SetAsync(Player.UserId, Player.Stats.MaxHealth.Value)
Stamina1:SetAsync(Player.UserId, Player.Stats.Stamina.Value)
Points1:SetAsync(Player.UserId, Player.Stats.Points.Value)
end)
game.Players.PlayerAdded:connect(function(Player)
while wait(30) do
Level1:SetAsync(Player.UserId, Player.Stats.Level.Value)
Yen1:SetAsync(Player.UserId, Player.Stats.Yen.Value)
Exp1:SetAsync(Player.UserId, Player.Stats.Exp.Value)
Strength1:SetAsync(Player.UserId, Player.Stats.Strength.Value)
MaxHealth1:SetAsync(Player.UserId, Player.Stats.MaxHealth.Value)
Stamina1:SetAsync(Player.UserId, Player.Stats.Stamina.Value)
Points1:SetAsync(Player.UserId, Player.Stats.Points.Value)
end
end)