|
| 16 Nov 2012 05:48 PM |
if Door.Transparency == 1 then Door.CanCollide = false end |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:49 PM |
i haven't worked with scripts since summertime but i don't see why that wouldn't work what's the full script? |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:50 PM |
local Door = script.Parent.Parent.Door1
function onClicked()
while Door.Transparency ~= 1 do Door.Transparency = Door.Transparency + 0.1 wait(0.1) if Door.Transparency == 1 then Door.CanCollide = false end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
SINCERELY - WANNABE TROLL |
|
|
| Report Abuse |
|
|
omahopah
|
  |
| Joined: 26 Jan 2011 |
| Total Posts: 5760 |
|
| |
|
|
| 16 Nov 2012 05:51 PM |
try this
local Door = script.Parent.Parent.Door1
function onClicked() while Door.Transparency ~= 1 do Door.Transparency = Door.Transparency + 0.1 wait(0.1) end Door.CanCollide = false end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:51 PM |
lolinodatdeyjustwontreplykaibcztheythinkimdonebutithinkifoundholeinscriptingonrobloxkai
SINCERELY - WANNABE TROLL |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:54 PM |
oh, and if you need an explanation:
the Door.Transparency == 1 line was within the while Door.Transparency ~= 1 block so, if the door transparency was one then the script would skip that entire block and not follow through to the Door.Transparency == 1 line |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:55 PM |
I tried that too, it still doesn't work. :L I hope ROBLOX hasn't broken something...
SINCERELY - WANNABE TROLL |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:57 PM |
Gragh, stuff it. Obviously ROBLOX broke something. I'm going to go play Arma 2.
SINCERELY - WANNABE TROLL |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:57 PM |
um what about
local Door = script.Parent.Parent.Door1
function onClicked() for i=1,10 do Door.Transparency = Door.Transparency + 0.1 wait(0.1) end Door.CanCollide = false end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
sorry if that doesn't work either try removing the 'local' before 'Door' on the first line or something sorry if i'm not helping out much, i haven't really worked with scripts since summertime like i said earlier :( |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 05:57 PM |
okay, have fun :) sorry i couldnt help |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 06:00 PM |
You've provided more help for me than scripting helpers did... Well, it worked. :D Thanks. I just wonder what the problem was with the original script...
SINCERELY - WANNABE TROLL |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 06:02 PM |
ah, you're welcome :)
"I just wonder what the problem was with the original script..."
it helps to indent every block so you can easily spot out conflicts, like so:
local Door = script.Parent.Parent.Door1
function onClicked()
while Door.Transparency ~= 1 do Door.Transparency = Door.Transparency + 0.1 wait(0.1) if Door.Transparency == 1 then Door.CanCollide = false end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
as you can see, line 8 is within line 5's block the script will see that the door's transparency is one and skip over line 5's entire block, which ends at line 11 the script will never get to line 8 no matter what :P |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 06:03 PM |
err i forgot that the forum reformats replies so that spaces at the beginning of lines aren't seen, sorry about that the idea is to either put one of those tab characters or a space at the beginning of every line, like this (pretend the underscores are spaces)
local Door = script.Parent.Parent.Door1
function onClicked() _ _while Door.Transparency ~= 1 do _Door.Transparency = Door.Transparency + 0.1 _wait(0.1) __if Door.Transparency == 1 then __Door.CanCollide = false __end _end end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2012 06:07 PM |
I see, thanks. One step closer to my Jurassic Park game/scenario.
SINCERELY - WANNABE TROLL |
|
|
| Report Abuse |
|
|