Why require return boolean value

I print require(“Square”) but It return true and I got an "attempt to index local ‘r’ " error, why it doesn’t return a cc.Scene??
How do deal with this? THANKS!

Square.lua

require “Cocos2d”
require “Cocos2dConstants”

local Square = class(“Square”,function()
    return cc.Scene:create()
end)

function Square.create()
    local square = Square.new()

return square
end
function Square:ctor()
    self.visibleSize = cc.Director:getInstance():getVisibleSize()
    self.x = cc.Director:getInstance():getVisibleOrigin().x
    self.y = cc.Director:getInstance():getVisibleOrigin().y
    self.schedulerID = nil
end

--call Square.lua in other file

local r = require(“Square”)
    local square = r.create()
    print(“square = “…string.format(”%s”,square))


I solved this by add
return Square
in the end of Square.lua

Thanks silent3713. I had a same problem fixed by your answer :smile: