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 » Scripting Helpers
Home Search
 

Re: Output says an '=' is expected near 'then' in line 3

Previous Thread :: Next Thread 
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 07:31 PM
Also, I'm not sure if in line 2 I put the right event.

local c = script.Parent
script.Parent.Clicked:connect(function(part)
if part = script.Parent then
part.Transparency = 1
wait (1)
part.Transparency = 0
end
end)
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 07:32 PM
when saying something is equal to, use ==. Like this



local c = script.Parent
script.Parent.Clicked:connect(function(part)
if part == script.Parent then
part.Transparency = 1
wait (1)
part.Transparency = 0
end
end)
Report Abuse
zakary99 is not online. zakary99
Joined: 19 Jan 2010
Total Posts: 1095
08 Apr 2012 07:32 PM
if part == ???
Report Abuse
zakary99 is not online. zakary99
Joined: 19 Jan 2010
Total Posts: 1095
08 Apr 2012 07:33 PM
We wrote the same thing at the same time. I was gonna say try that. :P
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 07:33 PM
Also didn't catch this, Clicked isn't an event



Put a clickdetector in the brick




local c = script.Parent
script.Parent.ClickDetector.Clicked:connect(function(part)
if part = script.Parent then
part.Transparency = 1
wait (1)
part.Transparency = 0
end
end)
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 07:36 PM
Yeah I had a click detector on the brick but I didn't know how to type the event. And I've never understand why you can't just put =. Not ==.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 07:42 PM
@Quo

That wouldn't work :S

† KMXD †
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 07:49 PM
Knight, what would the event be then.
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 07:51 PM
would it be Clicked()
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 07:53 PM
nop that doesnt work
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 07:55 PM
MouseButton1Down, I think I totally forgot.
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 07:58 PM
so try

local c = script.Parent
script.Parent.ClickDetector.Mouse1ButtonDown:connect(function(part)
if part = script.Parent then
part.Transparency = 1
wait (1)
part.Transparency = 0
end
end)
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 08:00 PM
Fail by me...

local c = script.Parent
script.Parent.ClickDetector.MouseClick:connect(function(part)
if part = script.Parent then
part.Transparency = 1
wait (1)
part.Transparency = 0
end
end)
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 08:08 PM
I tried that, and it didn't work, but nothing is coming out of output.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 08:13 PM
@Quo

No, just combine the things you said... The second fix, you forgot to do the first.

† KMXD †
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 08:15 PM
So

script.Parent.ClickDetectorMouseClick:connect(function(part)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 08:16 PM

local c = script.Parent

script.Parent.ClickDetector.MouseClick:connect(function(part)
if part == script.Parent then --I don't get it
part.Transparency = 1
wait (1)
part.Transparency = 0
end
end)

† KMXD †
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 08:18 PM
you don't understand the 3rd line? :o
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 08:18 PM
@ wwe, the 3rd line is pretty pointless
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 08:19 PM
i dont need it??
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 08:20 PM
Nope, this should work fine.



local c = script.Parent
script.Parent.ClickDetector.MouseClick:connect(function(part)
part.Transparency = 1
wait (1)
part.Transparency = 0
end)
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 08:26 PM
Raig it wont work still e.e
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Apr 2012 08:30 PM
@Quo

That would change the player's transparency... which would error...

† KMXD †
Report Abuse
Quovis is not online. Quovis
Joined: 24 Mar 2012
Total Posts: 494
08 Apr 2012 08:31 PM



try this.



local c = script.Parent
script.Parent.ClickDetector.MouseClick:connect(function(part)
script.Parent.Transparency = 1
wait (1)
script.Parent.Transparency = 0
end)
Report Abuse
wwemaniac99 is not online. wwemaniac99
Joined: 10 Mar 2010
Total Posts: 41496
08 Apr 2012 08:31 PM
@Knight: Yes, the output said transparency is not a valid member of player

I'm confused what (part) even does in the second line of this script anyways
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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