generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Image Button doesnt detect when clicked

Previous Thread :: Next Thread 
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 11:41 AM
--Made by supermisstruth
--Open/Close GUI script
local button = script.Parent
local text = script.Parent.Parent.Menu
local openScreen = script.Parent.Parent.Parent.openScreen.Menu

button.MouseButton1Click:connect(function() --Doesnt print "clicked" when button is clicked
print("Clicked")
button.Visible = false
text.Visible = false
openScreen.Visible = true
--The Button and the text will disapear because another GUI will open
--When the user will close the newly opened GUI the button and the text will appear again
end)
Report Abuse
SpeedyJZoel is not online. SpeedyJZoel
Joined: 16 Aug 2010
Total Posts: 2416
11 Jul 2016 11:42 AM
Try changing MouseButton1Click to MouseButton1Down


Speedy J. Zoel || Robux: R$1,312 || RAP: R$80,994
Report Abuse
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 02:31 PM
still doesnt work
Report Abuse
Egzekiel is not online. Egzekiel
Joined: 10 Jan 2011
Total Posts: 1079
11 Jul 2016 02:41 PM
Either your button is covered by another gui element or your variable is not well defined.
I suggest you search for how to define the Local Player as a variable and know the name of its childrens.

Well, i'll help you.

--Must be in a Localscript
local plr=game.Players.LocalPlayer
local pg=plr.PlayerGui

Put the rest in here, don't forget to define the button and the open screen.


Report Abuse
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 03:24 PM
--Made by supermisstruth
--Open/Close GUI script
local plr=game.Players.LocalPlayer
local pg=plr.PlayerGui
local afkScreen = pg.MainGUI.afkScreen
local imgButton = afkScreen.ImageButton
local Menu = afkScreen.Menu


imgButton.MouseButton1Down:connect(function() --Doesnt print "clicked" when button is clicked
print("Clicked")
imgButton.Visible = false
Menu.Visible = false
--The Button and the text will disapear because another GUI will open
--When the user will close the newly opened GUI the button and the text will appear again
end)
Report Abuse
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 03:41 PM
anyone could help >_>
Report Abuse
averysumner is not online. averysumner
Joined: 30 Nov 2013
Total Posts: 27
11 Jul 2016 03:48 PM
Maybe instead of using objects, you could make the button in your script.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
11 Jul 2016 03:53 PM
if there is a gui ontop of it, it wont fire.


Report Abuse
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 06:47 PM
there is no GUI on top of it
Report Abuse
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 07:10 PM
@averysummer
even if I made it out of scripts, what would be wrong with my script?
Report Abuse
RaulChaser is not online. RaulChaser
Joined: 07 Dec 2014
Total Posts: 655
11 Jul 2016 07:31 PM
Your script should be working. I see nothing wrong with it.
~[When there is darkness, there is always light!]~
Report Abuse
supermisstruth is not online. supermisstruth
Joined: 11 Oct 2009
Total Posts: 158
11 Jul 2016 07:40 PM
I feel so dumb, i putted my imgButton into a frame >.<
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image