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 would I do this?

Previous Thread :: Next Thread 
Bitwyl is not online. Bitwyl
Joined: 15 Nov 2014
Total Posts: 7276
12 Dec 2014 05:58 PM
I want a brick to dissapear when clicked, but I want to add the clickdetector through the script.

I know you would do Instance.new('ClickDetector', script.Parent)

Buhhhh how do I encorporate that into a function?
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
12 Dec 2014 06:04 PM
local cd = Instance.new('ClickDetector')
cd.Parent = script.Parent

cd.Clicked:connect(function()

end)

???
Report Abuse
whyitmatters is not online. whyitmatters
Joined: 06 Apr 2013
Total Posts: 294
12 Dec 2014 06:05 PM
Put this script in the part!!!

--Script--


function onClicked()

x = script.parent

x.Transparency = 1



Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
12 Dec 2014 06:06 PM
One does not simply leave their script that unfinished.
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
12 Dec 2014 06:25 PM
local Part=script.Parent
local clickDetector=Instance.new('ClickDetector',Part)
clickDetector.MaxActivationDistance=15

local Enabled,Hidden=false,false
local maxTransparency=.75

mouseClicked=function()
if not Enabled then
Enabled=true
if not Hidden then
for i=0,20 do
Part.Transparency=0+maxTransparency*(i/20)
wait(1/33)
end
Hidden=true
else
for i=0,20 do
Part.Transparency=maxTransparency+-maxTransparency*(i/20)
wait(1/33)
end
Hidden=false
end
Enabled=false
end
end
clickDetector.MouseClick:connect(mouseClicked)
Report Abuse
Bitwyl is not online. Bitwyl
Joined: 15 Nov 2014
Total Posts: 7276
13 Dec 2014 04:29 AM
Thanks sly, I got an idea now!
@above slightly overdone..? O.o
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
13 Dec 2014 10:56 AM
Seems like you don't understand the concepts of being pro
Report Abuse
Bitwyl is not online. Bitwyl
Joined: 15 Nov 2014
Total Posts: 7276
13 Dec 2014 11:25 AM
Pro doesnt simply mean make the most complex script on a simple thing. And your script doesn't define "pro", just because it looks long doesn't mean you're above all others.

Sorry bud.
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
13 Dec 2014 01:42 PM
not talking about length or quantity, the script i wrote just simply wasn't "transparency=1 end)end)end)end)print(end)end)". It's complexity just differentiates it from the others making it pro, unique.
Report Abuse
Bitwyl is not online. Bitwyl
Joined: 15 Nov 2014
Total Posts: 7276
13 Dec 2014 04:23 PM
All I needed was transparency = 1

If I wanted it to do more than that, I would have done something like yours. (Which still isn't close to a pro level)
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
13 Dec 2014 04:34 PM
LOL'd ok
Report Abuse
anaIyze is not online. anaIyze
Joined: 29 May 2014
Total Posts: 2048
13 Dec 2014 04:34 PM
'for i=0,20 do
Part.Transparency=maxTransparency+-maxTransparency*(i/20)
wait(1/33)
end'

Not a pro LOL
Report Abuse
Bitwyl is not online. Bitwyl
Joined: 15 Nov 2014
Total Posts: 7276
13 Dec 2014 04:35 PM
You're super funny. Changing brick properties is now considered a pro level? Heh..
Report Abuse
juniorjfive is not online. juniorjfive
Joined: 05 Jan 2010
Total Posts: 671
13 Dec 2014 04:42 PM
the proerest

brick.BrickColor=BrickColor.new''

am i faz3 yet?
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