import numpy as np

def scroll(clip, h=None, w=None, x_speed=0, y_speed=0,
           x_start=0, y_start=0, apply_to="mask"):
    """ Scrolls horizontally or vertically a clip, e.g. to make end
        credits """
    if h is None: h = clip.h
    if w is None: w = clip.w
    
    xmax = clip.w-w-1
    ymax = clip.h-h-1

    def f(gf,t):
        x = max(0, min(xmax, x_start+ np.round(x_speed*t)))
        y = max(0, min(ymax, y_start+ np.round(y_speed*t)))
        return gf(t)[y:y+h, x:x+w]
    
    return clip.fl(f, apply_to = apply_to)

@@ -344,16 +344,20 @@
     x = 
+int(
 max(0, m
@@ -387,32 +387,33 @@
 und(x_speed*t)))
+)
 %0A        y = max
@@ -409,16 +409,20 @@
     y = 
+int(
 max(0, m
@@ -460,16 +460,17 @@
 eed*t)))
+)
 %0A       

Add int() wrapper to prevent floats