What’s the problem with my code?
The problem is that I want to save “Value”, “MinValue” and “MaxValue” (DoubleConstrainedValue)
The part of the code that is the problem
if success and GetStats ~= nil then
rsd.Value = GetStats[1]
rsd.MaxValue = GetStats[1]
rsd.MinValue = GetStats[1]
points.Value = GetStats[2]
points.MaxValue = GetStats[2]
points.MinValue = GetStats[2]
print("StatsData loaded for "..PlayerAdded.Name)
else
rsd.Value = 0
rsd.MaxValue = 100
rsd.MinValue = 0
points.Value = 0
points.MaxValue = 10
points.MinValue = 0
print("New StatsData for "..PlayerAdded.Name)
end
When I try to save only “Value” then everything works properly.
Code that works properly:
if success and GetStats ~= nil then
rsd.Value = GetStats[1]
points.Value = GetStats[2]
print("StatsData loaded for "..PlayerAdded.Name)
else
rsd.Value = 0
points.Value = 0
print("New StatsData for "..PlayerAdded.Name)
end