Why does this Script Work in Test Mode Only?
I know it's a free model, but I've always wondered WHY it stopped working. I know some ROBLOX update broke it around a year ago. It caused most vehicle tool scripts to break and not do anything when commanded. Can anyone look at it and see what's wrong with it please? It works fine in Test mode, just not in online
Here's the script:
008 | local b = Instance.new( "Part" ) |
009 | b.Parent = game.Workspace |
010 | b.CFrame = gun.CFrame + (gun.CFrame.lookVector * 10 ) |
012 | b.Size = Vector 3. new( 1 , 1 , 2 ) |
015 | b.BrickColor = BrickColor.new( 24 ) |
018 | local bv = Instance.new( "BodyVelocity" ) |
019 | bv.velocity = gun.CFrame.lookVector * 400 |
021 | local s = script.Parent.Rocket:Clone() |
026 | function onButton 1 Down(mouse) |
029 | while turn = = true do |
031 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
032 | heli.Parts.Engine.BodyGyro.cframe = mouse.Hit |
040 | function onButton 1 Up() |
044 | function onKeyDown(key) |
046 | if key = = "y" and fly = = false and script.Parent.Parent.Parent.Character:FindFirstChild( "Helicopter" ) ~ = nil then |
048 | heli = script.Parent.Parent.Parent.Character.Helicopter |
049 | if heli.Parts:FindFirstChild( "Motor1" ) ~ = nil then |
050 | heli.Parts.Motor 1. BottomSurfaceInput = "Constant" |
052 | if heli.Parts:FindFirstChild( "Motor2" ) ~ = nil then |
053 | heli.Parts.Motor 2. BottomSurfaceInput = "Constant" |
055 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
056 | heli.Parts.Engine.BodyVelocity.maxForce = Vector 3. new( 1 e+ 009 , 1 e+ 009 , 1 e+ 009 ) |
057 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 5 , 0 ) |
059 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 0 , 0 ) |
061 | elseif key = = "x" and fly = = true then |
064 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
065 | heli.Parts.Engine.BodyVelocity.maxForce = Vector 3. new( 0 , 0 , 0 ) |
066 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 0 , 0 ) |
069 | if heli.Parts:FindFirstChild( "Motor1" ) ~ = nil then |
070 | heli.Parts.Motor 1. BottomSurfaceInput = "NoInput" |
072 | if heli.Parts:FindFirstChild( "Motor2" ) ~ = nil then |
073 | heli.Parts.Motor 2. BottomSurfaceInput = "NoInput" |
076 | elseif key = = "w" and fly = = true then |
079 | if hover = = false then |
081 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
082 | heli.Parts.Engine.BodyVelocity.velocity = heli.Parts.Engine.CFrame.lookVector * a |
088 | elseif key = = "s" and fly = = true then |
091 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
092 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 0 , 0 ) |
095 | elseif key = = "d" then |
099 | elseif key = = "a" then |
103 | elseif key = = "f" and fly = = true then |
106 | local gun 1 = heli.Parts:FindFirstChild( "Gun1" ) |
107 | local gun 2 = heli.Parts:FindFirstChild( "Gun2" ) |
108 | local gun 3 = heli.Parts:FindFirstChild( "Gun3" ) |
109 | local gun 4 = heli.Parts:FindFirstChild( "Gun4" ) |
128 | elseif key = = "e" and fly = = true then |
131 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
132 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 5 , 0 ) |
137 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
138 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 0 , 0 ) |
141 | elseif key = = "q" and fly = = true then |
144 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
145 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 ,- 5 , 0 ) |
150 | if heli.Parts:FindFirstChild( "Engine" ) ~ = nil then |
151 | heli.Parts.Engine.BodyVelocity.velocity = Vector 3. new( 0 , 0 , 0 ) |
157 | function onSelect(mouse) |
159 | mouse.Button 1 Down:connect( function () onButton 1 Down(mouse) end ) |
160 | mouse.Button 1 Up:connect(onButton 1 Up) |
161 | mouse.KeyDown:connect(onKeyDown) |
164 | script.Parent.Selected:connect(onSelect) |