How can I convert this Python code into Roblox code?

How would I turn this Python code into Roblox code:

class Human:
    def walk(self):
        print("Walk")


class Dog(Human):
    def bark(self):
        print("Bark")


dog = Dog()
dog.bark()
dog.walk()

2 Likes

Why would you want to do this?

Perhaps this could work @AustnBlox


function walk(hum)
        print("Walk")


function bark(dog)
        print("Bark")



bark(dog)
walk(hum or dog)

1 Like

So that I can have two classes which share the same ability.

Example: Humans can walk and a dogs can too, so I want the dog to share the same functions (abilities) like you would use in OOP. So my dog can walk and bark. But my question was how do I convert this into roblox code.

1 Like
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.