|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 03 May 2014 04:42 PM |
bump4 Thought this was scripting helpers. |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 04:43 PM |
bump5 Thought this was scripting helpers. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 03 May 2014 04:44 PM |
| end expected to close function at line 6 near elseif |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 03 May 2014 04:51 PM |
roblox world record of most bump jk |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 03 May 2014 04:53 PM |
| Should have asked this before, but what is wrong, how is it not working? |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 03 May 2014 05:01 PM |
urgh! ugh! come on! work already! |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|