How to change this HUD's position?

I used this tutorial: How To Make MOUSEOVER TEXT! Roblox - YouTube. It works, but I want there to be another text underneath the first one, one for the item name and the one below it for the item’s description. I don’t see any numbers, so I don’t know what to do. Help?

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local label = script.Parent

function updatePos()
	local target = mouse.Target
	if target and target:FindFirstChild("ItemName") then
		label.Position = UDim2.fromOffset(mouse.X, mouse.Y)
		label.Text = target.ItemName.Value
		label.Visible = true
	else
		label.Visible = false
	end
end

mouse.Move:Connect(updatePos)

updatePos()
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local label = script.Parent

function updatePos()
	local target = mouse.Target
	if target and target:FindFirstChild("ItemDesc") then
		label.Position = UDim2.fromOffset(mouse.X, mouse.Y)
		label.Text = target.ItemDesc.Value
		label.Visible = true
	else
		label.Visible = false
	end
end

mouse.Move:Connect(updatePos)

updatePos()
2 Likes

You can create a frame which holds this content so like this

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local label = script.Parent

function updatePos()
	local target = mouse.Target
	if target and target:FindFirstChild("ItemName") then
		label.Position = UDim2.fromOffset(mouse.X, mouse.Y)
		label.Text = target.ItemName.Value
        description.Text = target.ItemDescription.Value -- description
		label.Visible = true
	else
		label.Visible = false
	end
end

mouse.Move:Connect(updatePos)

updatePos()
1 Like

I’m not sure that’s what I meant.
shirt
this is what happens when I duplicate the text and add the same script with different names. “Red Flannel Shirt” in the middle is the name, while “A mostly clean red flannel shirt” is the description. I want “A mostly clean red flannel shirt” to be moved underneath “Red Flanel Shirt”

1 Like