I think that this script should work. It is supposed to change the text in a textbox when I hover over a certain item. When I hover over the item, the text in the textbox does not visually change but it changes in the properties menu. Please help!
Script:
local antimony = game:GetService("StarterGui").AboutBox.TextBox.Text script.Parent.ClickDetector.MouseHoverEnter:connect(function() antimony = "My bed." end) script.Parent.ClickDetector.MouseHoverLeave:connect(function() antimony = "..." end)
Use a LocalScript
located in StarterGui
and define the variables as such.
-- if the LocalScript is inside the screenGui, you could do something like this local antimony = script.Parent.AboutBox.TextBox -- change for your situation local clickDetector = workspace:WaitForChild("ClickDetector") -- define this correctly -- use antimony.Text clickDetector.MouseHoverEnter:Connect(function() antimony.Text = "My bed." end) clickDetector.MouseHoverLeave:Connect(function() antimony.Text = "..." end)
Use PlayerGui. And you can't do this:
local antimony = ....TextBox.Text antimony = "My bed."
As it will not change the text, but assign its value to the variable, and then assign "My bed." to the variable. Do this instead:
local antimony = ....TextBox antimony.Text = "My bed."
First please use the LUA before writing the script and second you need to access the PlayerGui not the StarterGui. Simple mistake.