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
 

Why wont this script work?

Previous Thread :: Next Thread 
RaiderOfCookies is not online. RaiderOfCookies
Joined: 24 Jan 2013
Total Posts: 189
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
Illlusions is not online. Illlusions
Joined: 18 Aug 2010
Total Posts: 726
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
RaiderOfCookies is not online. RaiderOfCookies
Joined: 24 Jan 2013
Total Posts: 189
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
VisualGraphics is not online. VisualGraphics
Joined: 26 Nov 2010
Total Posts: 6515
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
Illlusions is not online. Illlusions
Joined: 18 Aug 2010
Total Posts: 726
30 Nov 2014 11:18 AM
I think that should work...
Report Abuse
dexperaux is not online. 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 is not online. 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 is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
30 Nov 2014 12:43 PM
.6 works just fine.
Report Abuse
godlymortal is not online. godlymortal
Joined: 15 Jul 2012
Total Posts: 14
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
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