Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This script will not make the tray of my plane seat, transparent. What is wrong?

Asked by
Myaxp 3
10 years ago

I have tried to get this tray to work on this chair for an aeroplane I was making (You know the serving trays at the back of a seat). If I click the button I provided it with, then it will not go transparent but the other seems to take effect.

Example:

||..................... -Tray is not visible --- Tray1
||
||  -Tray is visible --- A
||

-Press the Button-

||____________ -Now visible 
||
||  -Still visible              -Both tray are visible
||

This is the code I have done: "Normal script"

T1 = script.Parent.Parent.Tray1 --This is the other one that makes the tray flip up. The second part that is horizontal
T2 = script.Parent.Parent.A --This tray is the 1 part of the picture that "IS" Viable that is Vertical
V = script.Parent.Value   -- Links to the value
V = 0 --Giving a value
--------------------------------

function open()
    if V.Value == 0 then
        T1.Transparency = 0
        T1.CanColide = true
        T2.Transparency = 1 -- Yet the part does not go transparent...
        V.Value = 1 --Think this is how you set the value... I think
    else
        T1.Transparency = 1
        T1.CanColide = false
        T2.Transparency = 0
        V.Value = 0 -- Again "Think" it is
    end
end

script.Parent.ClickDetector.MouseClick:connect(open)

This is a plane I was building but sometimes on my other ones I have had to do this.

Model layout:

Model -Tray1,A,Button

In the button - ClickDetector,Script,Value(Set to 0)

So I don't know what the problem is. Is there anyone that can help me? If I can get this right then the rest should be easy for me. This is my first question and the layout is odd -.-

0
Are there errors in the output? BlueTaslem 18071 — 10y
0
Fixed them... Thanks! Also huge fan of your work! Myaxp 3 — 10y

Answer this question