Overwrite OOP function?

function Mob:Patrol()
-first run function
self.Patrol = function() --Can I overwrite here?
                --new function
        end
end

Why would you need to overwrite the Patrol function inside of the Patrol function…?
Seems redundant.

But to answer your question, yes, it’s possible.

1 Like

Wanted to make it in such a way where each time the function changes
successfully done it after trying to having the different functions separated and called depending on how many times the main function ran. However still wondering if it can be changed within the function (as in changing the function from inside it)


Yes.

1 Like