|
| 17 Apr 2014 04:59 PM |
function myfunction()
Workspace.bomber.landing.Transparency = 0 end
script.Parent.ClickDetector.MouseClick:connect(myfunction)
^Heres my code.^ I use the code to make the landing legs invisible. However, its not working due to some "Disconnected Event due to Exception".
Anyone's input on this? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 05:05 PM |
transparency = 1 -- invisible transparency = 0 -- visible
|
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 05:06 PM |
| If it's a model, you cant set transparency on a model -.- |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Apr 2014 05:09 PM |
You can only set transparency onto Parts, Wedges, and CornerWedges.
If you say guis, its backgroundtransparency |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 05:12 PM |
Put the script inside the click detector. Ill assume the click detector is inside the bomber, like this:
Workspace -Bomber --Button ---ClickDetector ----Script --landing ----------------------------------------------------- clicker = script.Parent bomber = clicker.Parent.Parent
function click()
bomber.landing.Transparency = 1
end
clicker.MouseClick:connect(click) ------------------------------------------------------ The good thing about making it this way is that you can have several bombers and 1 button only affect 1 bomber, for example:
Workspace -Bomber --Button ---ClickDetector ----Script --landing -Bomber --Button ---ClickDetector ----Script --landing -Bomber --Button ---ClickDetector ----Script --landing
here you have 3 bombers, with your script it would call any of them, but with mine it's calling only the corresponding bomber |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 05:13 PM |
| Is "landing" a part or a model? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 05:15 PM |
Landing is a model.
It goes like this.
-Workspace
- Bomber
- Button
-Script/Click Detector
-landing
-landing gear parts.etc
I have three submodels. A fuseluge/wing, the button, and a landing gear. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2014 05:18 PM |
function myfunction() lndg = game.Workspace.bomber.landing:GetChildren() for _, v in pairs(lndg) do v.Transparency = 1 end end
script.Parent.ClickDetector.MouseClick:connect(myfunction) |
|
|
| Report Abuse |
|
|