Attempting to use [self]

I think you’re trying to create a class. That should be done as follows:

local safeZone = {}
safeZone.__index = safeZone

function safeZone.new()
    local newSafeZone = {
        Bag = "Fortnite"
    }

    return setMetatable(newSafeZone, safeZone)
end

function safeZone:updateSafezone()
    print(self.Bag)
end

return safeZone

Only now you’ll be able to perform safeZone:updateSafezone().

Read here for further information:

1 Like