I am trying to make a GUI that appears when you die, then disappears again, but I get an error: X cannot be assigned to - Client - LocalScript:14
All kinds of help will be appreciated, here’s the code:
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
local dead = Instance.new("ScreenGui")
local text = Instance.new("TextLabel")
dead.Parent = player.PlayerGui
text.Parent = dead
text.BackgroundTransparency = 1
text.Size = UDim.new(59)
text.Position.X = 0.1, 0
text.Position.Y = 0.913, 0
text.TextColor3 = Color3.new(255, 255, 255)
text.Text = player.Name .. " Died."
dead.Enabled = true
wait(3)
dead.Enabled = false
end)