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

[Unsolved] ImageButton not working?

When the imagebutton is hover over or even clicked on it don't work i don't know how to do clone() which that probably what I need to do can someone explain what I did wrong and show me how to fix it?

--Image: Gold
--Version: PC
-----------------
for n,p in pairs(game.Players:GetChildren()) do
    p:FindFirstChild("PlayerGui")

end
function onClick() --When left mouse is clicked 
if game.Lighting.Shops.Gold.Visible == false then
game.Lighting.Shops.Gold.Visible = true
elseif game.Lighting.Shops.Gold.Visible == true then
game.Lighting.Shops.Gold.Visible = False
end
end
-----------------
function MouseEnter() --When Mouse hover over the Image
game.Lighting.Tips.Gold.Visable = true
end
-----------------
function MouseLeave() --When Mouse move away from over the Image
game.Lighting.Tips.Gold.Visable = false 
end
-----------------
--Connect the Mouse!
Button.MouseButton1Click:connect(onClick)
Button.MouseButton1Down:connect(MouseEnter)
Button.MouseButton1Up:connect(MouseLeave)

2 comments

1

On line 13 and 17 you spelled Visible wrong. Also, you are doing this in Lighting, You need to get the PlayerGui. Also, what is Button? it was not defined from what I can see

0

okay how do i get the player gui?

1 answer

You spelled Visible wrong on 13 and 14, also, like Temp was saying, you need to find the Player Gui, I would do it as..

for n,p in pairs(game.Players:GetChildren()) do
	p:FindFirstChild("PlayerGui")
	--blahblahcode
end

1 comment

0

Still dont work

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