#Referencing custom data types

7 messages · Page 1 of 1 (latest)

solar talon
#

How would i go by doing this

#

not exactly just the basics

solar talon
#

made the class made the child, now how do i reference it

#

i have this as my base class:

local Ability = {}

function Ability.new()
    local ReturningData = {}
    ReturningData.Name = "AbilityBase"
    ReturningData.Damage = 50
    ReturningData.Cooldown = 2.5
    function ReturningData:UseAbility(player)
        print("Ability used ", ReturningData.Name, " by ", player)
    end

    return ReturningData
end

return Ability
#

and this as my child class:

local ServerStorage = game:GetService("ServerStorage")
local AbilityClass = require(ServerStorage.Ability)

local A = AbilityClass.new()

A.Name = "Blah Blah"
A.Cooldown = 2
A.Damage = 50

return A
#

now in a function i want to pass an "Ability" as an argument

#

like this, but how?