On studio my game death message area works just fine. but in Roblox it just shows complete black or white.
task.wait(1)
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local lPlayer = Players.LocalPlayer
local Character = lPlayer.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Messages
Humanoid.Died:Connect(function()
Humanoid.Parent:Destroy()
for _, item in pairs(lPlayer.PlayerGui:GetChildren()) do
if item:IsA("ScreenGui") and item.Name ~= "DeathScreen" then
item.Enabled = false
end
end
local Room = game.ReplicatedFirst.DeathScreen:Clone()
Room.Parent = workspace
Room.Name = "DeathScreen_" .. Character.Name
local ClonedCharacter = ReplicatedStorage.Ghosts:FindFirstChild("Ghost" .. string.split(Character.Name, "_")[1])
ClonedCharacter.Parent = Room
script.Parent.Enabled = true
ClonedCharacter.PrimaryPart.CFrame = Room.Character.CFrame
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = Room.Cam1.CFrame
task.wait(2.5)
TweenService:Create(workspace.CurrentCamera, TweenInfo.new(20), {CFrame = Room.Cam3.CFrame}):Play()
if not Messages then
Messages = {"That's odd...", "...I'm not sure how you died."}
end
table.insert(Messages, "You made it as far as Floor " .. workspace.CurrentFloor.Value .. ".")
for _, text in pairs(Messages) do
script.Parent.TextLabel.Text = text
TweenService:Create(script.Parent.TextLabel, TweenInfo.new(2), {TextTransparency = 0}):Play()
task.wait(6)
TweenService:Create(script.Parent.TextLabel, TweenInfo.new(2), {TextTransparency = 1}):Play()
task.wait(4)
end
task.wait(3)
Room:Destroy()
workspace.CurrentCamera.CameraType = Enum.CameraType.Orbital
end)
ReplicatedStorage.UpdateMessage.OnClientEvent:Connect(function(messages)
Messages = messages
end)
I’ve tried everything I can, and I’m stuck