#how do i make returning return the entire module

1 messages · Page 1 of 1 (latest)

foggy mantle
#

when i return when the animation stops it doesnt return the module

function module.DomainPopUp(char, ani)
    local anim = char.Humanoid.Animator:LoadAnimation(ani)
    local stopped = anim.Stopped:Once(function()
        if anim.TimePosition < anim.Length then
            char:SetAttribute("ExpandingDomain", false)
            char:SetAttribute("InSkill", false)
            print("STOPPED")
            return "stopped"; --this
        end
    end)
end
simple dawn
#

function module.DomainPopUp(char, ani)
local anim = char.Humanoid.Animator:LoadAnimation(ani)
local returnValue = nil
local completed = Instance.new("BindableEvent")

anim.Stopped:Once(function()
    if anim.TimePosition < anim.Length then
        char:SetAttribute("ExpandingDomain", false)
        char:SetAttribute("InSkill", false)
        print("STOPPED")
        returnValue = "stopped"
        completed:Fire()
    else
        completed:Fire()
    end
end)

anim:Play()
completed.Event:Wait()
return returnValue

end

I edited

#

If it doesn't work lmk

foggy mantle
final sandal
#

because if so you need to do ```

local module = {}

--your code

return module```