#why is my message NOT removing after i die?
1 messages · Page 1 of 1 (latest)
repeat wait() until #game.Players:GetPlayers() > 0
function message(text)
local msg = Instance.new("Message", game.StarterGui)
msg.Name = "GameMessage"
msg.Text = text
wait(3)
msg:Destroy()
end
function endmessage()
local randomplr = game.Players:GetChildren()[math.random(1,#game.Players:GetChildren())]
randomplr.Character.Humanoid.Health = 0
for i,v in game.Players:GetChildren() do
print(v)
local gun = game.Lighting.Pistol:Clone()
local flashlight = game.Lighting.Flashlight:Clone()
flashlight.Parent = v.Backpack
gun.Parent = v.Backpack
end
end
message("Humans, defend yourselves towards the zombies.")
wait(3)
endmessage()
if game.StarterGui:WaitForChild("GameMessage") ~= nil then
game.StarterGui:WaitForChild("GameMessage"):Destroy()
end
it is only the message that is the issue?
yes
when you die
it does not remove
they told me it was deprecated
like is the items are given?
@tribal heron
Try this
function showMessage(text)
for _, player in pairs(game.Players:GetPlayers()) do
local gui = Instance.new("ScreenGui")
gui.Name = "GameMessageGui"
gui.ResetOnSpawn = true
gui.Parent = player:WaitForChild("PlayerGui")
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 0.1, 0)
label.Position = UDim2.new(0, 0, 0, 0)
label.BackgroundTransparency = 0.5
label.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
label.TextColor3 = Color3.fromRGB(255, 255, 255)
label.Font = Enum.Font.SourceSansBold
label.TextSize = 32
label.Text = text
label.Parent = gui
task.delay(3, function()
if gui then
gui:Destroy()
end
end)
end
end
Lmk if it didn’t work
dayum hes creating a brand new textlabel
thank you. i questioned myself why it didnt work with messages or texlabels
i actually used an textlabel too
but i guess it didnt work
also ty for the free "hint"
Fixed?
Alr
tym
Lmk if you have any questions
tysm
ye
Hi
Show
I’ll take a look
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local showMessageRemote = ReplicatedStorage:WaitForChild("ShowMessage")
showMessageRemote.OnClientEvent:Connect(function(text)
local existingGui = player:FindFirstChild("PlayerGui"):FindFirstChild("GameMessageGui")
if existingGui then
existingGui:Destroy()
end
local gui = Instance.new("ScreenGui")
gui.Name = "GameMessageGui"
gui.ResetOnSpawn = true
gui.Parent = player:WaitForChild("PlayerGui")
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 0.08, 0)
label.Position = UDim2.new(0, 0, 0.02, 0)
label.BackgroundTransparency = 0.3
label.BackgroundColor3 = Color3.new(0, 0, 0)
label.TextColor3 = Color3.new(1, 1, 1)
label.Font = Enum.Font.GothamBold
label.TextScaled = true
label.Text = text
label.Parent = gui
task.delay(3, function()
for i = 1, 10 do
label.TextTransparency = i * 0.1
label.BackgroundTransparency = 0.3 + (i * 0.07)
task.wait(0.05)
end
gui:Destroy()
end)
end)
** You are now Level 2! **
done?
.
The new script
but ill take it
basically.
the function "teamdeath" changed the team of a player upon its death.
and there was an function that detected if a team of player number equals 0.
You want me to fix it?
Alrighty