I’m trying to detect which level number is greater than the other, and then direct the game what to do if poslevel is greater than neglevel or if neglevel is greater than poslevel. However, when I run the script everything before the if statements work but the script skips everything after and does not print the tempchange at the end, what have I done wrong?
game.ServerScriptService.ValueChanged.Event:Connect(function(value, poslevel, neglevel)
print("received!")
changerate = changerate + value
print(neglevel, poslevel)
if type(tonumber(neglevel)) > type(tonumber(poslevel)) then
tempchange = -1
if type(tonumber(poslevel)) > type(tonumber(neglevel)) then
tempchange = poslevel - 1
if type(tonumber(neglevel)) == type(tonumber(poslevel)) then
tempchange = 0
print(tempchange)
end
end
end
end)