Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

[Unsolved] ImageButton not working?

Asked by 10 years ago

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)
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 Tempestatem 884 — 10y
0
okay how do i get the player gui? GuardainDev 45 — 10y

1 answer

Log in to vote
0
Answered by
Vividex 162
10 years ago

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
0
Still dont work GuardainDev 45 — 10y
Ad

Answer this question