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: Why Wont This Work?

Previous Thread :: Next Thread 
IJustWasted1k is not online. IJustWasted1k
Joined: 27 Mar 2013
Total Posts: 1416
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
killaman333 is not online. killaman333
Joined: 16 Jan 2013
Total Posts: 1143
10 Nov 2015 07:14 PM
it looks like it.



Don't look at me like that.
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
10 Nov 2015 07:16 PM
...
Report Abuse
IJustWasted1k is not online. IJustWasted1k
Joined: 27 Mar 2013
Total Posts: 1416
10 Nov 2015 07:34 PM
+ 1
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
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 is not online. 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
jumpykilldestroy is not online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
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
cowsoncows is not online. cowsoncows
Joined: 11 Oct 2013
Total Posts: 2522
10 Nov 2015 07:47 PM
Variables are for values, usually not lines of code...
Report Abuse
jumpykilldestroy is not online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
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
IJustWasted1k is not online. IJustWasted1k
Joined: 27 Mar 2013
Total Posts: 1416
10 Nov 2015 07:59 PM
Thanks :D
Report Abuse
LilMcManiac is not online. LilMcManiac
Joined: 31 Oct 2011
Total Posts: 2812
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
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