|
| 10 Nov 2015 06:29 PM |
local Brick = script.Parent local WindowOn = script.Parent.Transparency = 0.5 local WindowOff = script.Parent.Transparency = 0 function OnClicked () if WindowOff then WindowOn end end
Brick.ClickDetector.MouseClick:connect(OnClicked)
|
|
|
| Report Abuse |
|
|
|
| 10 Nov 2015 07:14 PM |
it looks like it.
Don't look at me like that. |
|
|
| Report Abuse |
|
|
cgjnm
|
  |
| Joined: 22 Dec 2011 |
| Total Posts: 2347 |
|
| |
|
| |
|
|
| 10 Nov 2015 07:35 PM |
YouJustWastedYourTime
you can't do that
either turn it into a function or just put it into the main |
|
|
| Report Abuse |
|
|
cgjnm
|
  |
| Joined: 22 Dec 2011 |
| Total Posts: 2347 |
|
|
| 10 Nov 2015 07:35 PM |
| http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2015 07:43 PM |
Brick=script.Parent function OnClicked () script.Parent.Transparency=script.Parent.Transparency==0 and .5 or script.Parent.Transparency end
Brick.ClickDetector.MouseClick:connect(OnClicked) |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2015 07:47 PM |
| Variables are for values, usually not lines of code... |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2015 07:49 PM |
heres a list of problems with it:
local Brick = script.Parent--nothing wrong but in the variables below you ignored this for some reason local WindowOn = script.Parent.Transparency = 0.5--you cant set object propertys like this just use a function instead local WindowOff = script.Parent.Transparency = 0--you need to do == not = when checking what propertys are --stuffs below is fine or things that i already went over function OnClicked () if WindowOff then WindowOn end end
Brick.ClickDetector.MouseClick:connect(OnClicked) |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Nov 2015 08:26 PM |
local Brick = script.Parent local Value = Brick.Transparency local WindowOn = 0.5 local WindowOff = 0 function onClicked() if Value == WindowOn then Value = WindowOff elseif Value == WindowOff then Value = WindowOn end end end
Brick.ClickDetector.MouseClick:connect(OnClicked) |
|
|
| Report Abuse |
|
|