Attempt to index string with text

Hello im trying to make a script where it stuff from a table in a module then puts that in the text when the players mouse hovers over it. But i get the error "attempt to index string with text"

i dont see any other posts about this so any help will be appreaciated!

script handling putting the name and description into the text

local item = require(game.ReplicatedStorage.items)

local x = script.Parent
local i = script.Parent.Parent.Parent
x.MouseEnter:Connect(function()
	i.thing.Name.Text = item.wood.name
	i.thing.desc.Text = item.wood.desc
	i.thing.lv.Visible = false
end)
local items = {
	
	wood = {
		img = "rbxassetid://11945135882",
		desc = "used for many stuff",
		name = "wood",
	},
}

return items

You’ve got i.thing.Name.Text which will give you the name of the object, you probably meant to do i.thing.name.Text judging by your other names.

Thank you, that was a very small thing that i overlooked.

1 Like

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