Hi, I’ve been trying to fix an issue with my Leveling system data, when it try’s to change the XP to *1.50. i get the error attempt to index a nil 'value'. Is there anything i done wrong?
if xp.Value >= maxXP.Value then --the line of code i get the error on.
Could you replace your xp.Changed Event with this and tell me if you get anything in the output just before the error?
xp.Changed:Connect(function()
if xp then
print(xp.Value)
end
if maxXP then
print(maxXP.Value)
end)
if xp.Value >= maxXP.Value then
leveling.Value = leveling.Value+1
xp.Value = 0
maxXP.Value = maxXP.Value*1.50
end
end)
Keeping codes clean for when the studio i work with hire’s other programmer’s and so it will be easy for them to understand what is what. If you know what i mean?