I've been getting back in to Roblox development and I've been doing super good at remembering the thing I've learned (7+ years ago ha-ha). I've run into a snag that I'm super confused by. I'll break it down within my code:
Animals = {"Pig", "Cow", "Chicken", "Sheep"}
ChosenAnimal = Animals[math.random(1,#Animals)]
Animal = script.Parent.Parent.Parent.ChosenAnimal
AnimalPrice = Animal.Price
Cash = script.Parent.Parent.Parent.Money
So basically, this is waiting for a Humanoid model to hit the block, which works beautifully. Then, I'm wanting to get the script to pick from a list of four animals and use that value in the "Animal" variable as you can see above.
I'm getting really frustrated, because if I use script.Parent.Parent.Parent.Pig, it operates as desired. It's only when I add the variable 'ChosenAnimal' into the end that I get the error.
"12:07:18.024 - ChosenAnimal is not a valid member of Model"
I assume that the 'Animal' line is having trouble pulling in the 'ChosenAnimal' variable, but I have no idea how to fix it and haven't found anything elsewhere to help me out. Please help?? :)

3 comments
I could kiss you! Thank you! :)
Random sub question... Does printing to console contribute at all to any game lag? I would leave the prints I have in this script running but there are at least 6/minute generated and I don't want to cause unnecessary lag if that's what it will do.
Shouldn't introduce any lag, and prints are only visible to people who enjoy looking at the console.