generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Hwo to get landing gear to become invisible?

Previous Thread :: Next Thread 
Spacefarer is not online. Spacefarer
Joined: 01 Jan 2011
Total Posts: 5904
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
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
17 Apr 2014 05:05 PM
transparency = 1 -- invisible
transparency = 0 -- visible
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 05:06 PM
If it's a model, you cant set transparency on a model -.-
Report Abuse
Spacefarer is not online. Spacefarer
Joined: 01 Jan 2011
Total Posts: 5904
17 Apr 2014 05:07 PM
Set to 1, not working.
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 05:09 PM
You can only set transparency onto Parts, Wedges, and CornerWedges.

If you say guis, its backgroundtransparency
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
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
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
17 Apr 2014 05:13 PM
Is "landing" a part or a model?
Report Abuse
Spacefarer is not online. Spacefarer
Joined: 01 Jan 2011
Total Posts: 5904
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
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image