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
in line 7 you must delete end.