|
| 30 Nov 2014 11:14 AM |
a = script.Parent
function onClicked(a) a.Transparency = .6 a.CanCollide = false wait(3) a.Transparency = 0 a.CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
|
| 30 Nov 2014 11:15 AM |
| We need a little more information... is that a script in a gui? a part? in lighting? Whats wrong with it? :L |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2014 11:16 AM |
Its a part, its suppose to act like a door, its in game.Workspace script.Parent = game.Workspace.Door is that enough |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2014 11:17 AM |
local a = script.Parent
function onClicked() a.Transparency = .6 a.CanCollide = false wait(3) a.Transparency = 0 a.CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
wus duh problem? |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2014 11:18 AM |
| I think that should work... |
|
|
| Report Abuse |
|
|
dexperaux
|
  |
| Joined: 18 Dec 2013 |
| Total Posts: 153 |
|
|
| 30 Nov 2014 12:39 PM |
local a = script.Parent
function onClicked() a.Transparency = .6 a.CanCollide = false wait(3) a.Transparency = 0 a.CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
i think its in a.Transparency = .6 you need to put 0.6, not .6 i think |
|
|
| Report Abuse |
|
|
Quasar99
|
  |
| Joined: 21 Nov 2009 |
| Total Posts: 9328 |
|
|
| 30 Nov 2014 12:41 PM |
its because you're defining two variables as "A" just remove the argument for onClicked() |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
|
| 30 Nov 2014 12:58 PM |
Lets start with naming your variable something meaningful. I believe this is a door correct? We should use a local variable as they run faster. Another thing you could space out your script by using the tab key and you don't need to say at the bottom script.Parent.ClickDetector.MouseClick:connect(onClicked) your new script should be
local door = script.Parent
door.ClickDetector.MouseClick:connect(function() door.Transparency = .6 door.CanCollide = false wait(3) door.Transparency = 0 door.CanCollide = true end)
I think if you remove the argument "a" the script will work. Why did you make the argument a anyway? The argument does not translate into the variable. |
|
|
| Report Abuse |
|
|