ROBLOX/Core-Scripts — pull request #16 by einsteinK (2014-05-21 11:18:30+00:00)
Title: Fixed issue #15

https://github.com/ROBLOX/Core-Scripts/issues/15: "attempt to index upvalue 'humanoidDiedConnection' (a nil value)"

Whenever SetCoreGuiEnabled("Health",false) is called while it is already disabled, it'll
try to disconnect all events.
When there never was a humanoid yet, this leads to events not being connected yet.

Changed the way startGui() starts, as it could yield forever in some cases.
Now it'll just check, "is there a Humanoid?", and handle what's needed.

healthChangedConnection and humanoidDiedConnection only get disconnected once they're set.
(Checking if humanoidDiedConnection isn't nil, as they get set at the same time)