Why won't this script work?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
01 | for _,food in pairs (game.Workspace:WaitForChild( "Holder" ):GetChildren()) do |
02 | food.Touched:connect( function (hit) |
03 | local other = hit.Parent:findFirstChild( "Food" ) |
04 | local player = hit.Parent:findFirstChild( "Humanoid" ) |
08 | elseif player ~ = nil then |
09 | local plr = player.Parent |
12 | local getValue = game.Players [ plr.Name ] :WaitForChild( "FoodAmount" ) |
14 | getValue.Value = getValue.Value + 1 |