|
| 27 Jun 2012 02:44 PM |
Sorry, this is like the fourth post I've made about the car I'm making, but when I comes to scripting, I'm pretty useless.
From the script you'll probably be able to tell what I'm trying to do. The output says something about a nil value.
---Bonnet[DOWN]
function OnClick() script.Parent.Transparency = 1 script.Parent.CanCollide = false script.Parent.Parent.Bonnet[UP].Transparency = 0 script.Parent.Parent.Bonnet[UP].CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
---Bonnet[UP]
function OnClick() script.Parent.Transparency = 1 script.Parent.CanCollide = false script.Parent.Parent.Bonnet[DOWN].Transparency = 0 script.Parent.Parent.Bonnet[DOWN].CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 02:47 PM |
What have I done wrong?
It starts off with Bonnet[UP] transparent and it's CanCollide is false, and Bonnet[DOWN] is the complete opposite.
I'm trying to make it so when you click the visible one it changes to the other, so it looks like you're opening/closing it. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 02:49 PM |
Your connect line doesn't match the function name.
"onClicked" vs "OnClick" |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 02:50 PM |
| Once again, you've saved my small brain. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 02:53 PM |
Wait, it still says 'attempt to call a nil value'.
Wat do? |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
|
| 27 Jun 2012 02:55 PM |
| It doesn't say, just says 'attempt to call a nil value'. |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 02:59 PM |
| Are the actual parts called Bonnet[Down] and Button[UP]? |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:01 PM |
Yeah, the one where it is open is 'Bonnet[UP]' The one where it is closed is 'Bonnet[DOWN]' |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 03:04 PM |
Take off the brackets because the script thinks its. Bonnet.UP and Bonnet.DOWN with UP and DOWN being the children or Bonnet. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:04 PM |
| Is there an actual reason for the output print or is ROBLOX having a dumb moment? |
|
|
| Report Abuse |
|
|
| |
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 03:06 PM |
| Then just edit the script and stuff |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:07 PM |
| Nope, still comes up with the same error... |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 03:08 PM |
Did you change the part name AND fix the script? If so copy the exact line that it says. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:10 PM |
Yup, changed the part and the script :/
Is it an issue that the open bonnet is cframed? |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:11 PM |
| Copy the exact line that what says? |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 03:11 PM |
| The output and it doesn't matter if it's C-Frame. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:12 PM |
The output says
attempt to call a nil value |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 27 Jun 2012 03:14 PM |
| And this script is within the button you are supposed to click right? |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:16 PM |
| Yes, Bonnet1 (I renamed them with numbers) has the script that makes Bonnet2 invisible, and vice-versa. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:19 PM |
| What's the exact new script you've got? Did you change the values in the scripts from "Bonnet[UP]" to "Bonnet1" like their new names are? |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:20 PM |
Lol guys
Bonnet["UP"]
Anything in the brackets should be quoted |
|
|
| Report Abuse |
|
|
lucas668
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 6183 |
|
|
| 27 Jun 2012 03:21 PM |
| I think we'd need the model to know how the "environment" of the script is set up, AKA where it's at in relation to everything being called. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2012 03:23 PM |
If that's too hard to understand..
---Bonnet[DOWN]
function OnClick() script.Parent.Transparency = 1 script.Parent.CanCollide = false script.Parent.Parent.Bonnet["UP"].Transparency = 0 script.Parent.Parent.Bonnet["UP"].CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(OnClick)
---Bonnet[UP]
function OnClick() script.Parent.Transparency = 1 script.Parent.CanCollide = false script.Parent.Parent.Bonnet["DOWN"].Transparency = 0 script.Parent.Parent.Bonnet["DOWN"].CanCollide = true end
script.Parent.ClickDetector.MouseClick:connect(OnClick) |
|
|
| Report Abuse |
|
|