I am working on an ability gui but I’m having troubles using functions inside of tables
This is what I want to accomplish but am having trouble with
I basically just need to find and run the function in the script based on whatever the players power string value is.
Any help is appreciated in advance, thanks.
local function PowerOne()
--power one stuff
end
local function PowerTwo()
--power Two stuff
end
local function PowerThree()
--power Three stuff
end
local Powers = {PowerOne(), PowerTwo(), PowerThree()}
for Cycle, Temp_Power in ipairs(Powers) do
if player.Power.Value == (Temp_Power) then --Line wont work or throw error
local Ability = Temp_Power
Ability()
end
end