l3oot
|
  |
| Joined: 10 Oct 2015 |
| Total Posts: 2821 |
|
|
| 25 Aug 2017 11:13 AM |
function onClicked() script.Parent.Parent.Gate.Transparency = 1 script.Parent.Parent.Gate.CanCollide = false script.Parent.Parent.sides.Transparency = 0 script.Parent.Parent.sides.CanCollide = true wait(.001) end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
it's a free model gate but i copied the 4th and 5th lines of code to add a cooler effect to the gate being opened but now the buttons just don't work
both Gate and sides are a union (it worked fine before i added the two lines)
|
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 25 Aug 2017 11:17 AM |
is there a clickdetector in the block
what does output say
|
|
|
| Report Abuse |
|
|
Ajastra
|
  |
| Joined: 01 Aug 2017 |
| Total Posts: 1461 |
|
|
| 25 Aug 2017 11:17 AM |
You can only wait for a minimum of about 1/30 seconds with wait() (and it will almost always be slightly more), so waiting for 0.001 seconds is redundant.
Check your output to see if there's any problems with your code. Is your capitalization correct and is everything where it should be?
|
|
|
| Report Abuse |
|
|
|
| 25 Aug 2017 04:39 PM |
| function ########### script.Parent.Parent.Gate.Transparency = # script.Parent.Parent.Gate.CanCollide = false wait(1) script.Parent.Parent.sides.Transparency = # script.Parent.Parent.sides.CanCollide = true wait(.001) end ######################################################### Now ist working before it opens the door and in the same Moment it Closes now the Door or gate is open for a ###### just Change it the longer you want. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2017 04:47 PM |
LOL at Preview it wasnt looking like that! But put wait(time the door is open) between script.Parent.Parent.Gate.CanCollide = false script.Parent.Parent.sides.Transparency = # |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2017 04:50 PM |
| When you use it like this than the door opens and Closes at the same Moment. |
|
|
| Report Abuse |
|
|
l3oot
|
  |
| Joined: 10 Oct 2015 |
| Total Posts: 2821 |
|
|
| 26 Aug 2017 11:31 AM |
ok so what i'm going for is like an 'animated' door without the physical animation of the gate opening
gate is the closed form
sides is the open form
i want gate to go invisible and collidable when sides goes visible and non-collidable and then vice versa when it closes
|
|
|
| Report Abuse |
|
|
l3oot
|
  |
| Joined: 10 Oct 2015 |
| Total Posts: 2821 |
|
|
| 26 Aug 2017 11:42 AM |
"Check your output to see if there's any problems with your code. Is your capitalization correct and is everything where it should be?"
wow this is embarrassing... so when i built the gate, i modeled the parts side and Gate and put the model inside of the entire gate model so when it was looking for Gate and sides in Parent.Parent it couldn't find it because they were inside the model....
|
|
|
| Report Abuse |
|
|
l3aited
|
  |
| Joined: 19 Dec 2016 |
| Total Posts: 8176 |
|
| |
|