Im trying to make the part that the character is touching disapear but instead the character is killed when i do this.
This is the script
food = Instance.new("Part", game.workspace.foodlist)
food.Touched:connect(function(food)
_G.score.Value = _G.score.Value + 1
food:Destroy()
end)

8 comments
That still kills the character
It also makes the parts stack on top of each other
Whoops, I accidentally put "hit" on line 5. I've edited it now. Does it work or does it still kill the character?
Nope nothing happens
It dosent kill the character tho
I have another script that randomly generates these food parts accross the map, and i limited it to max 10 instances and i figured out that it removes one of the parts but not the one its touching
Hmm.. Have you tried putting "local" before food on line 1? local food = Instance.new("Part", game.workspace.foodlist)
it worked, thanks!