Rather than use event.type, try:
if event is InputEventMouseButton:
Place that outside the rest of the statement, though, because otherwise godot will try and check if moving the mouse is pressed, which doesn't work
func input(event):
# If the user press a mouse button
if event is InputEventMouseButton:
if event.pressed:
if event.buttonindex == BUTTONLEFT