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: How do you simplify this again?

Previous Thread :: Next Thread 
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
20 Jun 2015 04:15 AM
script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked)
script.Parent.Transparency = 0.1
wait(0.1)
script.Parent.Transparency = 0.3
wait(0.1)
script.Parent.Transparency = 0.5
wait(0.1)
script.Parent.Transparency = 0.7
wait(0.1)
script.Parent.Transparency = 0.9
wait(0.1)
script.Parent.Transparency = 1
wait(0.1)
script.Parent:Destroy()

script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked)

end)



I have plans for MouseButton1Click and MouseButton2Click, which is why I defined them like that.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
20 Jun 2015 04:19 AM
for t = 0.1, 0.9, 0.2 do
script.Parent.Transparency = t;
wait(0.1);
end
script.Parent.Transparency = 1;
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
20 Jun 2015 04:20 AM
...connect(function(OnClicked)
for X = 1, 6 do
script.Parent.Transparency = math.min(-0.1 + 0.2 * X, 1)
wait(0.1)
end
script.Parent:Destroy()...

You were looking for a loop, I believe.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
20 Jun 2015 04:22 AM
script.Parent.MouseButton1Click.MouseClick:connect(function()
for i = .1,.9,.2 do
script.Parent.Transparency = i;
wait(.1);
end;
script.Parent.Transparency = 1;
script.Parent:Destroy();
end);
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
20 Jun 2015 04:31 AM
None of them worked. I'm confused.
Report Abuse
StarWars is not online. StarWars
Joined: 04 Jan 2007
Total Posts: 500
20 Jun 2015 04:34 AM
Is this for a gui or a brick?
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
20 Jun 2015 04:35 AM
A brick.
Report Abuse
StarWars is not online. StarWars
Joined: 04 Jan 2007
Total Posts: 500
20 Jun 2015 04:37 AM
script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked)
script.Parent.Transparency = 0.1
wait(0.1)
script.Parent.Transparency = 0.3
wait(0.1)
script.Parent.Transparency = 0.5
wait(0.1)
script.Parent.Transparency = 0.7
wait(0.1)
script.Parent.Transparency = 0.9
wait(0.1)
script.Parent.Transparency = 1
wait(0.1)
script.Parent:Destroy()

script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked)

end)

You are calling script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked) twice and you will be missing an end with this. Remove the second script.Parent.MouseButton1Click.MouseClick:connect(function(OnClicked)

Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
20 Jun 2015 04:38 AM
How could none of them work? I thought this was simplifying a script, not fixing one? .-.
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
20 Jun 2015 04:42 AM
I put it in a local script.

local part = game.Workspace.Part1
game.Workspace.Part1.MouseButton1Click.MouseClick:connect(function()
for i = .1,.9,.2 do
script.Parent.Transparency = i;
wait(.1);
end;
script.Parent.Transparency = 1;
script.Parent:Destroy();
end);
Report Abuse
StarWars is not online. StarWars
Joined: 04 Jan 2007
Total Posts: 500
20 Jun 2015 04:43 AM
That should work and you can use part.MouseButton1Click.MouseClick:connect(function()
instead of game.Workspace.Part1
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
20 Jun 2015 04:45 AM
I'm not getting any kind of error.

Is the script not running?
Report Abuse
StarWars is not online. StarWars
Joined: 04 Jan 2007
Total Posts: 500
20 Jun 2015 04:52 AM
Do you have a ClickDetector inside? And is the script enabled?
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
20 Jun 2015 04:54 AM
Yup. I feel like a total idiot right now but I still don't understand what's going on.
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