#trying to make a death screen

65 messages · Page 1 of 1 (latest)

mystic mica
#

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local screenGui = playerGui:FindFirstChild("DeathScreenGui")
if not screenGui then
screenGui = Instance.new("ScreenGui")
screenGui.Name = "DeathScreenGui"
screenGui.Parent = playerGui
end

local imageLabel = screenGui:FindFirstChild("DeathImage")
if not imageLabel then
imageLabel = Instance.new("ImageLabel")
imageLabel.Name = "DeathImage"
imageLabel.Size = UDim2.new(1, 0, 1, 0)
imageLabel.Image = "rbxassetid://13804272000"
imageLabel.BackgroundTransparency = 1
imageLabel.Visible = true
imageLabel.Parent = screenGui
end

local sound = playerGui:FindFirstChild("DeathSound")
if not sound then
sound = Instance.new("Sound")
sound.Name = "DeathSound"
sound.SoundId = "rbxassetid://8619297528"
sound.Volume = 1
sound.Looped = false
sound.Parent = playerGui
end

local function onDeath()
imageLabel.Visible = true
sound:Play()
end

local function setupCharacter(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(onDeath)
end

if player.Character then
setupCharacter(player.Character)
end

player.CharacterAdded:Connect(function(newChar)
imageLabel.Visible = false
sound:Stop()
setupCharacter(newChar)
end)

mystic mica
#

yeah

vital wing
#

mhm

mystic mica
#

i dont know code lmao

vital wing
#

yk about how to make screen gui?

mystic mica
vital wing
#

make a local script in the screengui

mystic mica
#

like this ?

vital wing
#

uhuh

mystic mica
vital wing
#

now make the script yourself

#

muhahaha

#

suffer

#

ok no wait

mystic mica
mystic mica
vital wing
#
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local screengui = script.parent
local DeathImage = screengui.DeathImage
DeathImage.Visible = false
char.Humanoid.Died:Connect(function(ondeath)
    DeathImage.Visible = true
    player.CharacterAdded:Connect(function()
        DeathImage.Visible = false
    end)
end)
mystic mica
#

i take only this in my script ?

vital wing
#

yes

mystic mica
#

okay i test

#

it don't worksad

vital wing
#

it didnt make the deathImage visible?

mystic mica
#

i don't know

#

the image just don't appear

vital wing
#

then there is something wrong with the properties

#

can u see the image when you are in studio

#

??

mystic mica
#

how to see

dusky schoonerBOT
#

studio** You are now Level 5! **studio

vital wing
#
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local screengui = script.parent
local DeathImage = screengui.DeathImage
DeathImage.Visible = false
DeathImage.Position = UDim2.new(0.5,0,0.5,0)
DeathImage.AnchorPoint = Vector2.new(0.5,0.5)
char.Humanoid.Died:Connect(function(ondeath)
    DeathImage.Visible = true
    player.CharacterAdded:Connect(function()
        DeathImage.Visible = false
    end)
end)
#

try this

mystic mica
#

okay

#

still not

vital wing
#

what does it show

#

when you reset?

mystic mica
#

nothing

vital wing
#

you are trying it on studio play right?

mystic mica
#

yes

vital wing
mystic mica
#

like this

vital wing
#

you are a dumbass

mystic mica
#

oh

#

thank yourizz

vital wing
#

and delete fond thing

mystic mica
#

its my first game sorry

#

i try

#

it dont work

vital wing
#

.

#

DUMB ASS

#

Save the deathscreengui in startergui

mystic mica
#

OHHHHHH

#

OKAY I AM ACOUSTIC

#

i place all in starter gui ?

#

i understand now...

#

and do you know how to make that

#

when i die

#

a song play

#

@vital wing