These few line of codes give me an error when I try to check the datastore value.
attempt to compare nil <= number
--// Update maxExperience
experience.Changed:Connect(function()
print(experienceData:Get()) -- Prints 50
repeat
if experienceData:Get() >= maxExperienceData:Get() then
levelData:Increment(1) -- Increases level by 1
maxExperienceData:Set(levelData:Get() * (1000 + math.random(0, 200) * level)) --Creates random Max XP basesd on level
--maxExperience.Value = maxExperienceData:Get()
end
until experienceData:Get() / maxExperienceData:Get() > 1
end)
experienceData:Set(50)
It is this line specifically
if experienceData:Get() >= maxExperienceData:Get() then