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
|
  |
| 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 |
|
|
|
| 12 Dec 2014 06:05 PM |
Put this script in the part!!!
--Script--
function onClicked()
x = script.parent
x.Transparency = 1
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 13 Dec 2014 10:56 AM |
| Seems like you don't understand the concepts of being pro |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| 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 |
|
|
|
| 13 Dec 2014 04:42 PM |
the proerest
brick.BrickColor=BrickColor.new''
am i faz3 yet? |
|
|
| Report Abuse |
|
|