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: Changing Gui while Mouse1 is down

Previous Thread :: Next Thread 
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 01:27 PM
I would like to change the background tranceparency of a background when it is clicked, then change it back again when it is released. The transparency gets changed when I click, but when I release it stays the same. How would I fix this.

function MouseDown (Gui)
Gui.BackgroundTransparency = 0
while Gui.Button1Down do
return
end
Gui.BackgroundTransparency = 1
end

C_2.MouseButton1Down:connect(function() MouseDown(C_2) end)
Report Abuse
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 03:41 PM
B
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Jul 2016 03:42 PM
MouseButton1Click

MouseButton1Up

bind these to functions
Report Abuse
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 03:48 PM
In what order?
Report Abuse
internal_kek is not online. internal_kek
Joined: 22 Jun 2016
Total Posts: 5
31 Jul 2016 04:00 PM
Use MouseEnter and MouseLeave instead.
http://wiki.roblox.com/index.php?title=API:Class/GuiObject/MouseEnter
http://wiki.roblox.com/index.php?title=API:Class/GuiObject/MouseLeave
Report Abuse
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 04:06 PM
It still doesnt work. I click it and it doesnt change when I let go

function MouseDown (Gui)
Gui.BackgroundTransparency = 0
while Gui.MouseButton1Up do
return
end
Gui.BackgroundTransparency = 1
end


C_2.MouseButton1Click:connect(function()CFrontUpdateVal() PlayerColor() MouseDown(C_2) end)
Report Abuse
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 04:13 PM
bump2
Report Abuse
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 04:26 PM
bump3
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Jul 2016 04:30 PM
Dude just use Click and Up

click will fire when you click

up will fire when you stop clicking

just bind 2 events
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
31 Jul 2016 04:38 PM
local gui = script.Parent

gui.MouseButton1Down:connect(function()
gui.BackgroundTransparency = 0
end)

gui.MouseButton1Up:connect(function()
gui.BackgroundTransparency = 1
end)


Report Abuse
PHChamp is not online. PHChamp
Joined: 01 Sep 2014
Total Posts: 211
31 Jul 2016 04:54 PM
Figured it out, thanks
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