I have a Gui that pops up when your mouse hovers over an object and a description box that changes depending on the item. I’m trying to get my local script and module script to match names according to the mouse’s target and retrieve the description, but its not changing.
That looks like its focusing more on what the mouse is pointing on than what I’m trying to achieve. It seems that solution/link is more focused on the mouse hovering over a GUI, while I’m just looking for a way to get the text property in a working billboard GUI to change.
Tracebacks are your best friend! They can be a little hard to read, but they tell you whats wrong with your code. Use them to your advantage. Figure out why are we indexing nil? Its because objectdescription[name] doesn’t exists. Adjust your code accordingly
Im getting a bit thrown off so lets start from after the ObjectName.Text
if objectdescription[mouse.Target.Name] then
if mouse.Target.Name == objectdescription[name] then
ObjectDesc.Text = objectdescription[mouse.Target.Name].Description
end
end
end
what you’re looking for should be something like this
UIS.InputChanged:Connect(function(input: InputObject, proc: boolean) --The first argument in InputChanged is the input that changed
if mouse.Target and mouse.Target:FindFirstChild("EasterEgg") then
local info = objectdescription[mouse.Target.Name] -- Does the targeted item exist in our table?
if info then
ObjectInfoGui.Enabled = true
ObjectInfoGui.Adornee = mouse.Target.Name
ObjectName.Text = mouse.Target.Name
ObjectDesc.Text = info.Description -- Set the text to the coresponding description
end
end
end)
Well, putting it in the way it is it wont function because the adornee is set to the name, however removing the name I just get the same results as I always do
Im wondering if something is wrong with ObjectName and ObjectDesc neither are changing their text, and they woudnt function as variables when put them under ObjectInfoGui or DescriptionBox which are their respective parents who have working variables. I had to write out the whole game.workspace.startgui…