Value not changing

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)

Try this…

game.ServerScriptService.ValueChanged.Event:Connect(function(value, poslevel, neglevel)
	print("received!")
	changerate = changerate + value
    neglevel = tonumber(neglevel)
    poslevel = tonumber(poslevel)
	print(neglevel, poslevel)

	if neglevel > poslevel then
		tempchange = -1
	elseif poslevel > neglevel then
		tempchange = poslevel - 1
	else
		tempchange = 0
    end
	print(tempchange)			
end)

type returns the Lua type of a variable (number, string, table, etc).