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

How do I make it so when you die it says something on the screen? [closed]

Asked by 6 years ago

It's confusing to me.

Closed as Not Constructive by minikitkat

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
theCJarmy7 1293 Moderation Voter
6 years ago
Edited 6 years ago

While ATestAccount420's answer would probably work, I would recommend using the .Died event.

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local hum = player.Character:WaitForChild("Humanoid")

hum.Died:connect(function()
    -- insert whatever you want in here
end)

This way, you are able to do other things in your script, without messing with spawn() or coroutines.

0
Ayy cj and that's true ATestAccount420 31 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

You'd do something like this, ofc you could customize the gui to how u like it but yeah.


local plr = game.Players.LocalPlayer local dead = false while true do if plr.Character.Humanoid.Health == 0 and dead == false then local guithingyidk = Instance.new('ScreenGui', plr.PlayerGui) local Text = Instance.new('TextLabel', guithingyidk) Text.Position = UDim2.new(0.5,0,0.5,0) Text.Text = "You Are Dead" Text.TextColor3 = Color3.new(1,0,0) Text.TextSize = 100 dead = true wait(6) dead = false end wait() end