I have a module script in ReplicatedStorage and a script in a tool. In the module script I have a function w. 3 parameters, the values of which are set in the script. For some reason, I used one of the parameters in the module script, and it errored, saying "chicken is not a valid member of StarterPack" in the module script.
MODULE SCRIPT:
local module = {}
local player = game.Players.LocalPlayer
local leaderstats = player.leaderstats
module.giveChickenEaten = function(chicken, chickenIntValue, biteAmount)
print("Calculating chicken eaten...")
leaderstats["Chicken Eaten"].Value = leaderstats["Chicken Eaten"].Value + game.StarterPack.chicken.chickenIntValue.Value --chikcen is not a valid member of StarterPack
biteAmount.Value = biteAmount.Value - 1
if biteAmount.Value == 0 then
chicken:Destroy()
end
end
return module
SCRIPT:
local module1 = require(game.ReplicatedStorage.ModuleScript) --where the module script is activated
module1.giveChickenEaten(script.Parent, script.Parent.coldFriedChickenValue.Value, script.Parent.biteAmount.Value)
--(this is activated inside a function)
Thanks!

3 comments
There's nothing called chicken, it was just the parameter
If there is nothing called "chicken" in the StarterPack, then you can't index it. If it's the parameter, it acts like a variable. Does removing "game.StarterPack" in line 7 help?
Thanks! I just had to remove all the ".value" parts. The biteAmount part still won't work, though (I deleted the .Value).