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
 

Why isn't this script not working?

Previous Thread :: Next Thread 
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:27 PM
A = script.Parent.A
B = script.Parent.B
C = script.Parent.C
D = script.Parent.D

function onClicked(mouse)

print("Door Clicked")

if (A.CanCollide == true) then
A.Transparency = 0.5
A.CanCollide = false
B.Transparency = 0.5
B.CanCollide = false
C.Transparency = 0.5
C.CanCollide = false
D.Transparency = 0
D.CanCollide = true
return
end

if (A.CanCollide == false) then
A.Transparency = 0
A.CanCollide = true
B.Transparency = 0
B.CanCollide = true
C.Transparency = 0
C.CanCollide = true
D.Transparency = 0.5
D.CanCollide = false
return
end

end

script.Parent.ClickDetector.MouseClick:connect(onClicked
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
03 May 2014 04:28 PM
This:

script.Parent.ClickDetector.MouseClick:connect(onClicked

Should have a ')' at the end of it:

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:29 PM
Sorry, forgot to highlight the whole script.
A = script.Parent.A
B = script.Parent.B
C = script.Parent.C
D = script.Parent.D

function onClicked(mouse)

print("Door Clicked")

if (A.CanCollide == true) then
A.Transparency = 0.5
A.CanCollide = false
B.Transparency = 0.5
B.CanCollide = false
C.Transparency = 0.5
C.CanCollide = false
D.Transparency = 0
D.CanCollide = true
return
end

if (A.CanCollide == false) then
A.Transparency = 0
A.CanCollide = true
B.Transparency = 0
B.CanCollide = true
C.Transparency = 0
C.CanCollide = true
D.Transparency = 0.5
D.CanCollide = false
return
end

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:35 PM
bump
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:38 PM
bump1
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:39 PM
bump2
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:40 PM
bump3
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:42 PM
bump4
Thought this was scripting helpers.
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:43 PM
bump5
Thought this was scripting helpers.
Report Abuse
SilverArgentum is not online. SilverArgentum
Joined: 01 Nov 2011
Total Posts: 1162
03 May 2014 04:43 PM
A = script.Parent.A
B = script.Parent.B
C = script.Parent.C
D = script.Parent.D

function onClicked(mouse)

print("Door Clicked")

if (A.CanCollide == true) then
A.Transparency = 0.5
A.CanCollide = false
B.Transparency = 0.5
B.CanCollide = false
C.Transparency = 0.5
C.CanCollide = false
D.Transparency = 0
D.CanCollide = true
return
end

elseif (A.CanCollide == false) then --changed the if here to elseif. That helps.
A.Transparency = 0
A.CanCollide = true
B.Transparency = 0
B.CanCollide = true
C.Transparency = 0
C.CanCollide = true
D.Transparency = 0.5
D.CanCollide = false
return
end

end
Report Abuse
SilverArgentum is not online. SilverArgentum
Joined: 01 Nov 2011
Total Posts: 1162
03 May 2014 04:44 PM
If that doesnt work, change "if (A.CanCollide == true) then" to "if (A.CanCollide == true) then do"
and "if (A.CanCollide == false) then" to "if (A.CanCollide == false) then do"
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:44 PM
end expected to close function at line 6 near elseif
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:47 PM
it shows when theres "elseif", but when i change it to "if" its okay, but i don't think it will work with "if".
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:50 PM
bump
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:51 PM
roblox world record of most bump
jk
Report Abuse
SilverArgentum is not online. SilverArgentum
Joined: 01 Nov 2011
Total Posts: 1162
03 May 2014 04:52 PM
Its a glitch. Just put another end at the end of the elseif block.

like this:

(original)
elseif a == b then do
print()
end
end

(new)
elseif a == b then do
print()
end
end
end

its a glitch that happens, sometimes all you actually have to do is cut and paste the whole script into a new script.
Report Abuse
SilverArgentum is not online. SilverArgentum
Joined: 01 Nov 2011
Total Posts: 1162
03 May 2014 04:53 PM
Should have asked this before, but what is wrong, how is it not working?
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:53 PM
will it still work?
Report Abuse
SilverArgentum is not online. SilverArgentum
Joined: 01 Nov 2011
Total Posts: 1162
03 May 2014 04:54 PM
50/50 chance, if it doesnt, do the cut and paste thing or just retype the whole script. might work, it happened to my hide and seek game millions of times.
Report Abuse
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
03 May 2014 04:55 PM
A = script.Parent.A
B = script.Parent.B
C = script.Parent.C
D = script.Parent.D

script.Parent.ClickDetector.MouseClick:connect(function(mouse)

print("Door Clicked")

if (A.CanCollide == true) then
A.Transparency = 0.5
A.CanCollide = false
B.Transparency = 0.5
B.CanCollide = false
C.Transparency = 0.5
C.CanCollide = false
D.Transparency = 0
D.CanCollide = true
return
end

elseif (A.CanCollide == false) then
A.Transparency = 0
A.CanCollide = true
B.Transparency = 0
B.CanCollide = true
C.Transparency = 0
C.CanCollide = true
D.Transparency = 0.5
D.CanCollide = false
return
end

end
end)

Im not sure what's wrong.
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:56 PM
It's a click door script.
I have a button where it will operate the doors and there are 4 doors.
1 door is supposed to be the opposite of the other 3 doors.
When I click the button that operates, it does nothing.
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 04:58 PM
yeah...
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 05:01 PM
urgh!
ugh!
come on!
work already!
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
03 May 2014 05:05 PM
this is jsut as important as other peoples problems you know
the script is not going to fix itself
Report Abuse
SilverArgentum is not online. SilverArgentum
Joined: 01 Nov 2011
Total Posts: 1162
03 May 2014 05:05 PM
Oh okay then. Be sure to add a click detector on the button model outside the script. Once you do that, save the click detectior in a variable at the top of the script.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 2Go to page: [1], 2 Next
 
 
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