So I tried creating a stamina module that sets a variable to true if a player has enough stamina however if I try to change this variable in a module script it won't return as true but as false how can I fix this?
Attack Script
local CanCast = false StaminaModule.TakeAwayStamina(Player,Amount,CanCast) wait() warn(CanCast) --CooldownModule.CreateAbilityCooldown(Player,10,"CooldownAbilityOne") if CanCast then
Module
local staminamodule = {} function staminamodule.TakeAwayStamina(Player,Amount,CanCast) local Atributes = Player.Atributes local Stamina = Atributes.Stamina if Stamina.Value >= Amount then Stamina.Value = Stamina.Value - Amount CanCast = true warn(CanCast) end end return staminamodule