How to stop the console from spamming someone's game?
Asked by
5 years ago Edited 5 years ago
004 | local debounce = false |
005 | local planedebounce = false |
006 | local stuntdebounce = false |
007 | local controlling = false |
008 | local currentspeed = 0 |
013 | local shooting = false |
015 | function fire(gun_Source, player) |
017 | local guns = gun_Source:GetChildren() |
019 | if guns [ i ] .Name = = "RocketLauncher" and guns [ i ] .className = = "Part" then |
020 | local shoot = Instance.new( "Part" ) |
021 | shoot.BrickColor = BrickColor.new( "Really black" ) |
022 | shoot.formFactor = "Plate" |
023 | shoot.Size = Vector 3. new( 1 , 0.4 , 2 ) |
024 | shoot.CFrame = guns [ i ] .CFrame * CFrame.new( 0 , 0 ,- 5 ) |
025 | shoot.Name = "Missile" |
026 | local d = game:GetService( "Debris" ) |
029 | local force = Instance.new( "BodyVelocity" ) |
032 | local x 1 = guns [ i ] .Velocity.x |
033 | local y 1 = guns [ i ] .Velocity.y |
034 | local z 1 = guns [ i ] .Velocity.z |
035 | force.velocity = Vector 3. new(x 1 +(x 1 / 5 ),y 1 +(y 1 / 5 ),z 1 +(z 1 / 5 )) |
037 | local creator = Instance.new( "ObjectValue" ) |
038 | creator.Name = "creator" |
039 | creator.Value = player |
040 | creator.Parent = shoot |
042 | local swoosh = script.Parent:findFirstChild( "Swoosh" ):clone() |
043 | swoosh.Parent = shoot |
045 | local boom = script.Parent:findFirstChild( "Explosion" ):clone() |
046 | boom.PlayOnRemove = true |
049 | local rocket = script:findFirstChild( "RocketScript" ):clone() |
050 | rocket.Disabled = false |
051 | rocket.Parent = shoot |
053 | shoot.Parent = Workspace |
056 | script.Parent:findFirstChild( "Reload" ):play() |
057 | local swish = script.Parent:findFirstChild( "FireRocket" ) |
061 | swish.Volume = swish.Volume - 0.025 |
069 | function fire_MachineGun(gun_Source, player) |
070 | while shooting = = true do |
072 | local guns = gun_Source:GetChildren() |
074 | if guns [ i ] .Name = = "MachineGun" and guns [ i ] .className = = "Part" then |
075 | local shoot = Instance.new( "Part" ) |
076 | shoot.BrickColor = BrickColor.new( "Bright yellow" ) |
077 | shoot.formFactor = "Custom" |
078 | shoot.Size = Vector 3. new( 0.4 , 0.4 , 2 ) |
079 | shoot.CFrame = guns [ i ] .CFrame * CFrame.new( 0 , 0 ,- 5 ) |
080 | shoot.Name = "Bullet" |
081 | local d = game:GetService( "Debris" ) |
084 | local force = Instance.new( "BodyVelocity" ) |
087 | force.velocity = guns [ i ] .CFrame.lookVector * 750 |
089 | local creator = Instance.new( "ObjectValue" ) |
090 | creator.Name = "creator" |
091 | creator.Value = player |
092 | creator.Parent = shoot |
094 | local shot = script:findFirstChild( "GunScript" ):clone() |
095 | shot.Disabled = false |
098 | shoot.Parent = Workspace |
101 | script.Parent:findFirstChild( "FireGun" ):play() |
107 | function computeDirection(vec) |
108 | local lenSquared = vec.magnitude * vec.magnitude |
109 | local invSqrt = 1 / math.sqrt(lenSquared) |
110 | return Vector 3. new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) |
113 | function move(point, engine) |
114 | local origincframe = engine:findFirstChild( "Direction" ).cframe |
117 | target = engine.Position+((point - engine.Position).unit* 100 ) |
118 | local dir = (target - engine.Position).unit |
119 | local spawnPos = engine.Position |
120 | left = engine.CFrame*CFrame.new(-size.x/ 2 , 0 , 0 ).p |
121 | right = engine.CFrame*CFrame.new(size.x/ 2 , 0 , 0 ).p |
122 | md = (target - engine.Position).magnitude |
124 | foebmd = engine.CFrame*CFrame.new( 0 , 0 , -md).p |
125 | toleft = (target -left).magnitude |
126 | toright = (target -right).magnitude |
127 | rot = ((foebmd - target).magnitude/ 10 ) |
128 | local pos = spawnPos + (dir * 1 ) |
129 | turn = math.rad((rot/ 10 )*engine.TiltFactor.Value) |
130 | if turn > math.rad( 89 ) then |
133 | if toleft< toright and toleft >rot then |
134 | engine:findFirstChild( "Direction" ).cframe = CFrame.new(pos, pos + dir)*CFrame.fromEulerAnglesXYZ( 0 , 0 , turn) |
135 | elseif toleft > toright and toright >rot then |
136 | engine:findFirstChild( "Direction" ).cframe = CFrame.new(pos, pos + dir)*CFrame.fromEulerAnglesXYZ( 0 , 0 , -turn) |
138 | engine:findFirstChild( "Direction" ).cframe = CFrame.new(pos, pos + dir) |
140 | engine:findFirstChild( "Direction" ).P = engine.TurnSpeed.Value |
143 | function findPlane(player) |
144 | local list = player.Character:GetChildren() |
146 | if (list [ x ] .Name = = "AircraftSeat" ) then |
153 | function onButton 1 Down(mouse) |
154 | local vehicle = findPlane(script.Parent.Parent.Parent) |
155 | if vehicle ~ = nil and debounce = = false and planedebounce = = false then |
156 | if fly = = false and taxi = = false then return end |
163 | local engine = vehicle |
164 | local position = mouse.Hit |
165 | local target = position.p |
167 | if planedebounce = = true or |
168 | controlling = = false then break end |
175 | function onButton 1 Up(mouse) |
179 | function onSelected(mouse) |
181 | game.Workspace.CurrentCamera.CameraSubject = bin.Parent.Parent.Character.Head |
182 | game.Workspace.CurrentCamera.CameraType = "Track" |
183 | mouse.Button 1 Down:connect( function () onButton 1 Down(mouse) end ) |
184 | mouse.Button 1 Up:connect( function () onButton 1 Up(mouse) end ) |
185 | mouse.KeyDown:connect(onKeyDown) |
186 | mouse.KeyUp:connect(onKeyUp) |
187 | mouse.Move:connect( function () Fly(mouse) end ) |
188 | mouse.Idle:connect( function () Fly(mouse) end ) |
191 | function onDeselected(mouse) |
192 | game.Workspace.CurrentCamera.CameraSubject = bin.Parent.Parent.Character.Humanoid |
193 | game.Workspace.CurrentCamera.CameraType = "Custom" |
197 | local vehicle = findPlane(script.Parent.Parent.Parent) |
198 | if (vehicle = = nil ) then return end |
199 | vehicle.Thrust.velocity = (vehicle.CFrame.lookVector * currentspeed) + Vector 3. new( 0 ,vehicle.LiftTrim.Value/ 100 , 0 ) |
202 | function onKeyDown(key) |
205 | local vehicle = findPlane(script.Parent.Parent.Parent) |
206 | if (vehicle = = nil ) then return end |
209 | vehicle.Direction.cframe = vehicle.CFrame |
210 | vehicle.Direction.maxTorque = Vector 3. new( 4 e 3 , 4 e 3 , 4 e 3 ) |
211 | vehicle.Thrust.maxForce = Vector 3. new( 9 e 20 , 9 e 20 , 9 e 20 ) |
213 | if currentspeed < vehicle.Speed.Value then |
214 | currentspeed = currentspeed + 1 |
215 | elseif currentspeed > vehicle.Speed.Value then |
216 | currentspeed = currentspeed - 1 |
218 | if vehicle.Acceleration.Value > 1000 then vehicle.Acceleration.Value = 1000 end |
219 | wait(( 1 -(vehicle.Acceleration.Value/ 1000 ))+ 0.01 ) |
220 | if fly = = false then break end |
226 | vehicle.Direction.maxTorque = Vector 3. new( 0 , 0 , 0 ) |
227 | vehicle.Thrust.maxForce = Vector 3. new( 0 , 0 , 0 ) |
230 | if vehicle.Speed.Value < vehicle.MaxSpeed.Value then |
231 | vehicle.Speed.Value = vehicle.Speed.Value + 10 |
235 | if vehicle.Speed.Value > - 10 then |
236 | vehicle.Speed.Value = vehicle.Speed.Value - 10 |
240 | vehicle.Speed.Value = vehicle.MaxSpeed.Value |
243 | vehicle.Speed.Value = 0 |
245 | if (key = = "'" ) and (bin.Locked.Value = = false ) then |
246 | local repl = script:clone() |
251 | if key = = "l" and fly = = true then |
252 | vehicle.Direction.maxTorque = Vector 3. new( 4 e 3 , 0 , 4 e 3 ) |
253 | local frame = vehicle:FindFirstChild( "OriginCFrame" ) |
255 | vehicle.Direction.cframe = frame.Value |
258 | vehicle.Direction.cframe = vehicle.CFrame |
259 | vehicle.Direction.maxTorque = Vector 3. new( 4 e 3 , 4 e 3 , 4 e 3 ) |
261 | if key = = "f" and missile = = false then |
262 | fire(vehicle, bin.Parent.Parent) |
264 | if key = = "c" and missile = = false then |
266 | fire_MachineGun(vehicle, bin.Parent.Parent) |
277 | local vehicle = findPlane(script.Parent.Parent.Parent) |
278 | if (vehicle = = nil ) then return end |
282 | bin.Selected:connect(onSelected) |
283 | bin.Deselected:connect(onDeselected) |
So, there's basically this plane we're using and every time you jump out of the pilot seat the game spams the hell out of pilots game with an error message saying that it can't find the Seat part
https://gyazo.com/5fff64b6d17c3ec6c7727e8d564cff08 --What it shows in the console
Anything I can add to the script to make that stop?