i'm trying to check a boolean value in the player to see if they have food, and stop the script if they do, or give them food and then set the value to true, but i dont know how to work this out
--this is the value for if you have food or not
local hasIngredient = game.Players:FindFirstChild("hasIngredient")
--this is inside a function
if hasIngredient.Value = true then --this just says expected identifier
print("you already have one") --just for testing
end
else
if db and player then
db = false
foodNumber.Value = foodNumber.Value - 1
foodLeft.Text = tostring(foodNumber.Value)
local inv = player.Backpack
local tool = game.ServerStorage["Tomato"]
tool:Clone().Parent = inv
hasIngredient.Value = true --i set the has food value to true afterwards
wait(2)
db = true
end

3 comments
If you're not going to post an explanation then use the comment instead. Even if it's wrong, at least post something with some code, that should at least answer or assist the poster.
This isn't even an answer. Make sure you write whatever you need to write in the comments, if they're not an explanation. I'm gonna start deleting answers like this if you don't at least assist the poster.
hey this person accepted my previous answer so why you delete a useful ?ner