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: Simple Question [URGENT]

Previous Thread :: Next Thread 
oOMrWonderfulOo is not online. oOMrWonderfulOo
Joined: 12 May 2012
Total Posts: 163
21 Aug 2016 07:22 PM
function OnClicked()
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.25
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.1
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.1
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.3
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.2
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.2
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.35
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.3
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.3
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.4
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.4
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.4
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.5
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.5
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.5
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.6
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.6
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.6
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.7
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.7
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.7
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.8
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.8
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.8
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.9
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.9
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.9
wait(0.01)
script.Parent.Parent.Frame.TextLabel.TextTransparency = 1
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 1
script.Parent.Parent.Parent.Shadow.ImageTransparency = 1
wait(0.01)
script.Parent.Parent.Frame.TextLabel.Visible = true
script.Parent.Parent.Parent.Taskbar.Visible = true
script.Parent.Parent.Parent.Shadow.Visible = true
wait(0.01)

script.Parent.MouseButton1Down:connect(OnClicked)

Is there something wrong with that script?
It goes in a Imagebutton

Also any way to simplify the script?
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
21 Aug 2016 07:24 PM
For loop. look it up on the wiki


Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
21 Aug 2016 07:24 PM
yes use loops and variables please
Report Abuse
imtellingmommy is not online. imtellingmommy
Joined: 10 Mar 2013
Total Posts: 817
21 Aug 2016 07:25 PM
"For loop"
Look at his script again.
Report Abuse
Encladeus is not online. Encladeus
Joined: 27 Dec 2010
Total Posts: 3839
21 Aug 2016 07:26 PM
function Transparency(n)
script.Parent.Parent.Frame.TextLabel.TextTransparency = n
script.Parent.Parent.Parent.Taskbar.ImageTransparency = n
script.Parent.Parent.Parent.Shadow.ImageTransparency = n
end

function OnClicked()
local T = 0
for i = 1, 10 do wait(0.01)
T = T + 0.1
Transparency(T)
end
wait(0.01)
script.Parent.Parent.Frame.TextLabel.Visible = true
script.Parent.Parent.Parent.Taskbar.Visible = true
script.Parent.Parent.Parent.Shadow.Visible = true
end

script.Parent.MouseButton1Down:connect(OnClicked)
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
21 Aug 2016 07:26 PM
all he has to do is add in a simple conditional for the 1 exception
Report Abuse
imtellingmommy is not online. imtellingmommy
Joined: 10 Mar 2013
Total Posts: 817
21 Aug 2016 07:27 PM
@enc

script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.3
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.2
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.2


also, really guys? have you noticed he used MouseButton1Down for click detectors?
Report Abuse
Encladeus is not online. Encladeus
Joined: 27 Dec 2010
Total Posts: 3839
21 Aug 2016 07:27 PM
My bad, you can't wait for (0.01) just leave it blank because you cannot wait shorter than 0.03
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
21 Aug 2016 07:29 PM
"also, really guys? have you noticed he used MouseButton1Down for click detectors?"

"It goes in an Imagebutton"

uh what?
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
21 Aug 2016 07:30 PM
You're stupid if you don't think a for loop can clean up his code.


Report Abuse
imtellingmommy is not online. imtellingmommy
Joined: 10 Mar 2013
Total Posts: 817
21 Aug 2016 07:32 PM
Never said otherwise. It's just that this snippet of code will probably bork it up if you blantly use it.

script.Parent.Parent.Frame.TextLabel.TextTransparency = 0.3
script.Parent.Parent.Parent.Taskbar.ImageTransparency = 0.2
script.Parent.Parent.Parent.Shadow.ImageTransparency = 0.2
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
21 Aug 2016 07:36 PM
local a = {0.25, 0.3, 0.35}

function OnClicked()
for i = 1,10 do
script.Parent.Parent.Frame.TextLabel.TextTransparency = a[i] or i/10
script.Parent.Parent.Parent.Taskbar.ImageTransparency = i/10
script.Parent.Parent.Parent.Shadow.ImageTransparency = i/10
wait()
end
script.Parent.Parent.Frame.TextLabel.Visible = true
script.Parent.Parent.Parent.Taskbar.Visible = true
script.Parent.Parent.Parent.Shadow.Visible = true
end

script.Parent.MouseButton1Down:connect(OnClicked)


Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
21 Aug 2016 07:37 PM
you should probably make variables for that stuff to clean it up more tho, i just copy pasted it.


Report Abuse
oOMrWonderfulOo is not online. oOMrWonderfulOo
Joined: 12 May 2012
Total Posts: 163
21 Aug 2016 07:43 PM
The current script i have wont work, and im not sure why, Any idea why it wont work
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