#My plane landing gears are not closing

57 messages · Page 1 of 1 (latest)

violet grotto
#

I have a plane and when i try to close the gears they wont close after a second they just dissapear can somebody help me fix it?

frosty spire
#

@violet grotto Can you send Videos/Scripts that are relevant?

violet grotto
#

ill send the script

#

local Event = script.Parent.Parent.Parent.Events.Gear
Event.OnServerEvent:Connect(function()
if script.Parent.p.Motor.DesiredAngle == 0 then
script.Parent.p.Motor.DesiredAngle = -1.7
wait(0.5)
for _,g in pairs(script.Parent.Cover:GetDescendants()) do
if g.Name == "Gear" then
for _,t in pairs(g.Model:GetChildren()) do
if t:IsA("MeshPart") or t:IsA("Part") or t:IsA("UnionOperation") then
t.Transparency = 1
t.CanCollide = false
end
end
end
end
else
wait(1)
for _,g in pairs(script.Parent.Cover:GetDescendants()) do
if g.Name == "Gear" then
for _,t in pairs(g.Model:GetChildren()) do
if t:IsA("MeshPart") or t:IsA("Part") or t:IsA("UnionOperation") then
t.Transparency = 0
t.CanCollide = true
end
end
end
end
script.Parent.p.Motor.DesiredAngle = 0
end
end)

frosty spire
#

Put it in a codeblock

violet grotto
#

what is a codeblock

frosty spire
#

put your code between the top and bottom backticks

violet grotto
#

ohh

#
local Event = script.Parent.Parent.Parent.Events.Gear
Event.OnServerEvent:Connect(function()
    if script.Parent.p.Motor.DesiredAngle == 0  then
        script.Parent.p.Motor.DesiredAngle = -1.7
        wait(0.5)
        for _,g in pairs(script.Parent.Cover:GetDescendants()) do
            if g.Name == "Gear" then
                for _,t in pairs(g.Model:GetChildren()) do
                    if t:IsA("MeshPart") or t:IsA("Part") or t:IsA("UnionOperation") then
                        t.Transparency = 1
                        t.CanCollide = false
                    end
                end
            end
        end
    else
        wait(1)
        for _,g in pairs(script.Parent.Cover:GetDescendants()) do
            if g.Name == "Gear" then
                for _,t in pairs(g.Model:GetChildren()) do
                    if t:IsA("MeshPart") or t:IsA("Part") or t:IsA("UnionOperation") then
                        t.Transparency = 0
                        t.CanCollide = true
                    end
                end
            end
        end
        script.Parent.p.Motor.DesiredAngle = 0
    end
end)
frosty spire
#

you need to press enter after typing lua

#

just edit your message

#

shift + enter

#

there ya go

violet grotto
#

i used same script with front landing gear

#

front is working but back ones not working

frosty spire
#

What should it be doing normally?

violet grotto
#

wdym

#

the script?

frosty spire
#

Like what should happen when u close the gear? Like should it have an animation, like what should the script be doing

violet grotto
#

oh

#

when i press G

#

the landing gears must go inside

#

the body

#

and go transparent

frosty spire
#

Go inside with an animation?

violet grotto
#

but they must have an animation

#

yeah

frosty spire
#

Where do you play the animation

#

I just see you waiting a certain amount of time and then making all parts transparent/opaque in this script

violet grotto
#

i didnt add any animation

quick ermineBOT
#

studio** You are now Level 4! **studio

violet grotto
#

i guess the scirpt has to move gears

#

90 degrees

frosty spire
#

Well theres your issue then no?

violet grotto
#

with motor

frosty spire
#

It doesnt apply any animation cause you didnt add any

violet grotto
#

how do i

frosty spire
#

although does the motor.desiredangle normally do the rotation?

violet grotto
#

yeah

#

front gears dont have an animation

frosty spire
#

Maybe the back wheels dont have the motors correctly setup then?

violet grotto
#

the script has to make motors work and the landing gears have to turn 90 degrees

#

uhm

#

i guess

#

but i dont have any experience about motors

#

lemme see

frosty spire
#

How did u do the front wheels?

#

just copy what u did there

#

since u said they work

violet grotto
#

i copied the front

#

but they dont work at rear wheels

#

ill try to animate it

#

when i animate it

#

can you help me create a script that runs the animation