local serverstorage = game:GetService("ServerStorage")
local player = game.Players.LocalPlayer
game.Workspace[player.Name].Humanoid.Died:connect(function()
wait(5)
game.Players[player.Name]:WaitForChild("FoodAmount").Value = 0
serverstorage.Main:Clone().Parent = game.Players[player.Name].PlayerGui
end)
This is in a localscript, and when a player dies, nothing happens, why? (Even after 5 seconds of waiting it does nothing just in case you are wondering)

2 comments
By the way, player.Character will access the players character, instead of having to do game.Workspace[player.Name]
try doing "game.Workspace:WaitForChild(player.Character).Humanoid.Died:connect(function()"