Trying to solve X Angle issue

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)

You cannot assign a value directly to X/Y/Z. Instead, do
text.Position = UDim2.new(.1, 0, .913, 0)

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.