So basically my script keeps running an error, everything else works fine in the script but whenever I get the boolean from calling the script like this;
if Cooldowns_Module:CheckForCooldown(Player, "Telekinetic Push", true) then
return
end
It keeps returning this error;
This is the script (the code is inside of a ModuleScript);
function CM:CheckForCooldown(Player, Ability_Name)
if Utilities_Module:Check("Object", "Ability Cooldowns", Player, true) then
task.spawn(function()
local Success, Error = pcall(function()
if Utilities_Module:Check("Object", Ability_Name, Player["Ability Cooldowns"], true) then
return true
elseif Utilities_Module:Check("Object", Ability_Name, Player["Ability Cooldowns"], false) then
return false
end
end)
if Error then
warn('Error: '..Error)
return
end
end)
elseif Utilities_Module:Check("Object", "Ability Cooldowns", Player, false) then
warn('Object: Ability Cooldowns was not found.')
return
end
end
Line 44 is the warn('Error: '…Error) part.
And it’s erroring during the return true/false statements for some reason and I’m not sure why but I need to figure out the issue so I can solve it, any tips?