I've tried to do this by using _G variable in a respawn script in order to signal when the NPC died, but this didn't work on the live game.
The respawn script was a regular script and the gui script was a local script in the starter gui of a player.
Could someone give a quick example? The basic respawn script is below if that helps, I'm pretty sure it has all the necessary parts.
target = script.Parent:Clone()
function Dead()
local respawn=target:Clone()
respawn.Parent=script.Parent.Parent
respawn:MakeJoints()
script.Parent:Destroy()
end
script.Parent.Humanoid.Died:Connect(Dead)

4 comments
Don't use _G, and you're using too many deprecated items. clone, connect,remove, and makeJoints are deprecated, use Clone, Connect, Destroy, and MakeJoints
wut, what is the difference between the connect and Connect?
How would you share variables among different scripts? That's the main point, the respawn script oddly still works despite the deprecated items.
@Kiriyato connect is deprecated. Connect should be used as it is not.