Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do uou make death screen?

Asked by
Tizzel40 243 Moderation Voter
6 years ago

Like when you die it will say "your character was killed by ..." or "Game over"

1 answer

Log in to vote
-1
Answered by
Leamir 3138 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

Hello, Tizzel40!

This script does exactaly what you want to do!

local KillMessage = "Game Over!"

while not game.Players.LocalPlayer.Character do wait() end
game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Died:connect(function()
    local Gui = Instance.new("ScreenGui")
    Gui.Parent = game.Players.LocalPlayer.PlayerGui
    local Label = Instance.new("TextLabel")
    Label.Parent = Gui
    Label.Size = UDim2.new(1,0,1,0)
    Label.TextScaled = true
    Label.Text = KillMessage
    Label.BackgroundTransparency = 1
end)

Good Luck with your games!

Ad

Answer this question