Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont my script work?

here is the code to the script, but it gives a error which I cant figure out.

if
 game.Players.NumPlayers.Humanoid.MaxHealth="0"
	then
	game.Lighting.RedKillScreen = game.StarterGui
end

2 comments

1

what is it supposed to do and there is SO MUCH STUFF WRONG WITH THAT.

0

it is when the player dies a gui shows

1 answer

I'm sorry all of your lines are WRONG. Just take this and go -_-

Insert this in Workspace.

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(chr)
		local human = chr:WaitForChild("Humanoid")
		human.Died:connect(function()
			game.Lighting.RedKillScreen:Clone().Parent = plr.PlayerGui
			print(plr.Name.." had died. May he rest in peace.") 
		end)
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.