Players.SunxLightz.Backpack.Pills.PillsS:11: attempt to perform arithmetic on field 'toHeal' (a nil value)
there a module named "STATS"
function HealUp(hum) hum.Health = hum.Health + stats.toHeal end
in module:
local module = {} toHeal = 75 return module
First, you need to have your "toHeal" variable inside the brackets of the module and you also need to make a variable inside your other script that requires the module. Example: In Module Script
local module = { toHeal = 75 } return module
In Script
local module = require(script.Parent.STATS) -- define the location of your module within the parenthesis local toHeal = module.toHeal local function HealUp(hum) hum.Health = hum.Health + toHeal end
Hope this helps!