Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to make the text label pop an image up when the mouse is hovering over it?

I was wonder how to make this script work because when i hover over the button everything else works but the image label... heres the code that i use if you see any errors in it please tell me and help me correct it. i know theres errors.

local player = game.Players.LocalPlayer
local GravityCoil = "1592513575"
local currency = player:WaitForChild('leaderstats').Coins
local amount = 100
local tool = game.ServerStorage:WaitForChild('GravityCoil')
local indextext = script.Parent.Text

script.Parent.MouseButton1Click:connect(function()
	if currency.Value >=100 and not player.Backpack:FindFirstChild('GravityCoil')or player.Character:FindFirstChild('GravityCoil')then
		
		currency.Value = currency.Value - amount
		local newtool = tool:Clone()
		newtool.Parent = player.Backpack
	else
		script.Parent.Text = "Purchase Failed, Try again later"
		wait(0.5)
		script.Parent.Text = indextext
	end
end)

script.Parent.MouseEnter:connect(function()
	script.Parent.Parent.Parent.productimage.Image = 'rbxassetid://'..GravityCoil
	script.Parent.Parent.Parent.Description.Text = script.descvalue.Value
	script.Parent.Parent.Parent.ProductTitle.Text = script.TitleValue.Value
end)
script.Parent.MouseEnter:connect(function()
	script.Parent.Parent.Parent.productimage.Image = GravityCoil
	script.Parent.Parent.Parent.Description.Text = ""
	script.Parent.Parent.Parent.ProductTitle.Text =""

end)

1 answer

Dear 410200cold2, The way i've always done it is insted of using your mouse enter you simply use script.Parent.MouseHover:connect(function()

script.Parent.OnMouseHover:connect(function()

This discussion is preserved as it was. New answers, comments, and votes are closed.