Advertisement
Derek1017

TARDIS

Mar 4th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.69 KB | None | 0 0
  1. local Isomorphic = false-- Indicates if only a few people can use the TARDIS.
  2. local Users = {"Derek1017, drwho91")-- Indicates who can fly the TARDIS (If isomorphic is true!)
  3. local RandomPosition = true
  4. local windy = true
  5.  
  6. local main = script.Parent
  7. local timel = main.Time
  8. local placel = main.Place
  9. local full = main.Parent
  10. local e1 = full.Entry
  11. local base = e1.Base
  12. local time = main.Timing
  13. local phase = false
  14. local strength = main.Strength
  15. local fly = main.Flying
  16. local work = main.Working
  17. local parts = main.Parts
  18. local comp = parts.Console
  19. local cont = comp.Control
  20. local radiob = cont.Radio
  21. local timeg = cont.Time
  22. local place = cont.Place
  23. local pad = cont.NumberPad
  24. local mode = main.Mode
  25. local go = cont.Go
  26. local locked = main.Locked
  27. local Starter = main.Starter
  28. local lock = cont.Lock
  29. local Shield = cont.Shield
  30. local shield = main.Shield
  31. local vector = cont.Vector
  32. local vectorV = main.VectorV
  33. local cent = comp.CenterThing
  34. local seat = comp.FlightSeat
  35. local open = main.Open
  36. local fuse = main.Fused
  37. local TBase = main.TardisBase
  38. local telebounce = false
  39. local dead = false
  40. local decalParts = {}
  41. local Decals = {}
  42. local matParts = {}
  43. local Materials = {}
  44. local Spots = {}
  45. local TardisParts = {}
  46. local PlayerDB = {}
  47. local nav = "Spots"
  48. local pump
  49.  
  50. cent.Hum:play()
  51. e1.Base.Hum:play()
  52. function GetTParts(obj)
  53. for i,p in pairs(obj:children()) do
  54. if (string.find(p.className,"Part")) or (string.find(p.className,"Seat")) or (string.find(p.className,"Platform")) then
  55. table.insert(TardisParts,p)
  56. end
  57. GetTParts(p)
  58. end
  59. end
  60. GetTParts(main)
  61. local EntryParts = {}
  62. local EntryColors = {}
  63. function GetEParts(obj)
  64. for i,p in pairs(obj:children()) do
  65. if (string.find(p.className,"Part")) or (string.find(p.className,"Seat")) or (string.find(p.className,"Platform")) then
  66. table.insert(EntryParts,p)
  67. table.insert(EntryColors,p.BrickColor)
  68. end
  69. GetEParts(p)
  70. end
  71. end
  72. GetEParts(e1)
  73. function Display()
  74. local status = "Navy blue"
  75. if (fly.Value) then
  76. status = "Brick yellow"
  77. end
  78. if (time.Value) then
  79. status = "Earth green"
  80. end
  81. if (fuse.Value) then
  82. status = "Sand red"
  83. end
  84. if (phase) then
  85. status = "Magenta"
  86. end
  87. if (dead) then
  88. status = "Black"
  89. end
  90. for i,p in pairs(TBase:children()) do if (p.Name == "StatusDisplay") then p.Part1.BrickColor = BrickColor.new(status) end end
  91. end
  92.  
  93. local new = Instance.new("BodyPosition")
  94. new.position = TBase.Position
  95. new.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  96. new.Parent = TBase
  97. local new = Instance.new("BodyGyro")
  98. new.cframe = TBase.CFrame
  99. new.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  100. new.Parent = TBase
  101. coroutine.resume(coroutine.create(function()
  102. for i = 1,math.huge do
  103. wait(0.1)
  104. Display()
  105. new.cframe = full.Entry.Base.CFrame
  106. end
  107. end))
  108.  
  109. function Weld(part0,part1,cf0,cf1)
  110. local w = Instance.new("Weld")
  111. local CJ = CFrame.new(part0.Position)
  112. w.Parent = part0
  113. w.Part0 = part0
  114. w.Part1 = part1
  115. w.C0 = part0.CFrame:inverse()*CJ
  116. w.C1 = part1.CFrame:inverse()*CJ
  117. w.Name = part1.Name
  118. part0.ChildRemoved:connect(function(removedWeld)
  119. if (removedWeld == w) then
  120. Weld(part0,part1,cf0,cf1)
  121. end
  122. end)
  123. wait()
  124. part1.Anchored = false
  125. end
  126.  
  127. for i,p in pairs(TardisParts) do
  128. Weld(TBase,p,TBase.CFrame:inverse(),p.CFrame:inverse())
  129. p.Anchored = false
  130. end
  131. for i,p in pairs(EntryParts) do
  132. Weld(base,p,base.CFrame:inverse(),p.CFrame:inverse())
  133. p.Anchored = false
  134. end
  135.  
  136. function PlaySound(sound,source,volume,soundrange,pitch)
  137. local p = Instance.new("Part")
  138. p.Anchored = true
  139. p.CanCollide = false
  140. p.Locked = true
  141. p.TopSurface = "Smooth"
  142. p.BottomSurface = "Smooth"
  143. p.formFactor = "Symmetric"
  144. p.Size = Vector3.new(1,1,1)
  145. p.Transparency = 1
  146. p.archivable = false
  147. p.Name = "SoundPlayer"
  148. p.Parent = workspace
  149. p.CFrame = CFrame.new(source)
  150. local s = Instance.new("Sound")
  151. s.SoundId = "http://www.roblox.com/asset/?id=" ..sound
  152. s.Pitch = pitch
  153. s.Volume = volume
  154. s.Parent = p
  155. s:play()
  156. game.Debris:AddItem(p,10)
  157. end
  158.  
  159. e1.Teleport.Touched:connect(function(hit)
  160. wait()
  161. if (hit == nil) or (telebounce) or (not open.Value) or (work.Value) or (time.Value) then return end
  162. local hitguy = hit.Parent
  163. if (hitguy:findFirstChild("Humanoid")) and (hitguy:findFirstChild("Humanoid").Health > 0) then
  164. telebounce = true
  165. hitguy.Torso.CFrame = hitguy.Torso.CFrame + (parts.Door.Teleport.Position - hitguy.Torso.Position)
  166. wait(3)
  167. telebounce = false
  168. end
  169. end)
  170. parts.Door.Teleport.Touched:connect(function(hit)
  171. wait()
  172. if (hit == nil) or (telebounce) or (not open.Value) or (work.Value) or (time.Value) then return end
  173. local hitguy = hit.Parent
  174. if (hitguy:findFirstChild("Humanoid")) and (hitguy:findFirstChild("Humanoid").Health > 0) then
  175. telebounce = true
  176. hitguy.Torso.CFrame = hitguy.Torso.CFrame + (e1.Teleport.Position - hitguy.Torso.Position)
  177. wait(3)
  178. telebounce = false
  179. end
  180. end)
  181.  
  182. function IsInside(small,big)
  183. local p = Instance.new("Part")
  184. p.Anchored = true
  185. p.Parent = workspace
  186. p.CFrame = small.CFrame - big.Position
  187. if (math.abs(p.Position.X) < (big.Size.X/2)) and (math.abs(p.Position.Y) < (big.Size.Y/2)) and (math.abs(p.Position.Z) < (big.Size.Z/2)) then
  188. local BrickIsIn = true
  189. print("Player is inside brick")
  190. else
  191. local BrickIsIn = false
  192. print("Player is not inside brick")
  193. end
  194. p:Remove()
  195. return BrickIsIn end
  196.  
  197. coroutine.resume(coroutine.create(function()
  198. for i = 1,math.huge do
  199. wait(0.05)
  200. if (time.Value) or (work.Value) or (fly.Value) then
  201. for i = 1,5 do
  202. for a,p in pairs(TBase:children()) do
  203. if (p.Name == "Pumpy") then
  204. p.C1 = p.C1 * CFrame.new(0,-0.1,0)
  205. end
  206. end
  207. wait(0.05)
  208. end
  209. for i = 1,15 do
  210. for a,p in pairs(TBase:children()) do
  211. if (p.Name == "Pumpy") then
  212. p.C1 = p.C1 * CFrame.new(0,0.1,0)
  213. end
  214. end
  215. wait(0.05)
  216. end
  217. for i = 1,10 do
  218. for a,p in pairs(TBase:children()) do
  219. if (p.Name == "Pumpy") then
  220. p.C1 = p.C1 * CFrame.new(0,-0.1,0)
  221. end
  222. end
  223. wait(0.05)
  224. end
  225. end
  226. end
  227. end))
  228. shield.Value = false
  229. local t,t2,guy,player,gui,tool,tool2,vp1,vp2,vp3,fba,fbv,tbv,tbg,tba
  230. for i,p in pairs(e1:children()) do
  231. if (p.Name == "SecretButton") then
  232. local cd = Instance.new("ClickDetector")
  233. cd.MaxActivationDistance = 7
  234. cd.Parent = p
  235. cd.MouseClick:connect(function()
  236. if (work.Value) or (shield.Value) or (time.Value) or (locked.Value) then return end
  237. if (open.Value) then
  238. open.Value = false
  239. e1.Base.Hum.Volume = 0
  240. for i,p in pairs(e1:children()) do
  241. if (p.Name == "DoorPart") then
  242. p.Transparency = 0
  243. p.CanCollide = true
  244. end
  245. end
  246. for i,p in pairs(e1:children()) do
  247. if (p.Name == "LabelPart") then
  248. p.Mesh.MeshType = "Brick"
  249. p.CanCollide = true
  250. end
  251. end
  252. for i,p in pairs(TBase:children()) do
  253. if (p.Name == "DoorPart") then
  254. p.Part1.Transparency = 0
  255. p.Part1.CanCollide = true
  256. end
  257. end
  258. else
  259. open.Value = true
  260. e1.Base.Hum.Volume = 0.75
  261. for i,p in pairs(e1:children()) do
  262. if (p.Name == "DoorPart") then
  263. p.Transparency = 1
  264. p.CanCollide = false
  265. end
  266. end
  267. for i,p in pairs(e1:children()) do
  268. if (p.Name == "LabelPart") then
  269. p.Mesh.MeshType = "FileMesh"
  270. p.CanCollide = false
  271. end
  272. end
  273. for i,p in pairs(TBase:children()) do
  274. if (p.Name == "DoorPart") then
  275. p.Part1.Transparency = 1
  276. p.Part1.CanCollide = false
  277. end
  278. end
  279. end
  280. end)
  281. end
  282. end
  283. for i,p in pairs(parts.Door:children()) do
  284. if (p.Name == "OpenButton") then
  285. local cd = Instance.new("ClickDetector")
  286. cd.MaxActivationDistance = 7
  287. cd.Parent = p
  288. cd.MouseClick:connect(function()
  289. if (work.Value) or (shield.Value) or (time.Value) or (locked.Value) then return end
  290. if (open.Value) then
  291. open.Value = false
  292. e1.Base.Hum.Volume = 0
  293. for i,p in pairs(e1:children()) do
  294. if (p.Name == "DoorPart") then
  295. p.Transparency = 0
  296. p.CanCollide = true
  297. end
  298. end
  299. for i,p in pairs(e1:children()) do
  300. if (p.Name == "LabelPart") then
  301. p.Mesh.MeshType = "Brick"
  302. p.CanCollide = true
  303. end
  304. end
  305. for i,p in pairs(TBase:children()) do
  306. if (p.Name == "DoorPart") then
  307. p.Part1.Transparency = 0
  308. p.Part1.CanCollide = true
  309. end
  310. end
  311. else
  312. open.Value = true
  313. e1.Base.Hum.Volume = 0.75
  314. for i,p in pairs(e1:children()) do
  315. if (p.Name == "DoorPart") then
  316. p.Transparency = 1
  317. p.CanCollide = false
  318. end
  319. end
  320. for i,p in pairs(e1:children()) do
  321. if (p.Name == "LabelPart") then
  322. p.Mesh.MeshType = "FileMesh"
  323. p.CanCollide = false
  324. end
  325. end
  326. for i,p in pairs(TBase:children()) do
  327. if (p.Name == "DoorPart") then
  328. p.Part1.Transparency = 1
  329. p.Part1.CanCollide = false
  330. end
  331. end
  332. end
  333. end)
  334. end
  335. end
  336.  
  337. vector.ClickDetector.MouseClick:connect(function()
  338. if vectorV.Value == 1 then
  339. vectorV.Value = 2
  340. else
  341. if vectorV.Value == 2 then
  342. vectorV.Value = 1
  343. end
  344. end
  345. end)
  346.  
  347. for i,p in pairs(workspace:children()) do
  348. if (string.find(p.Name,"TardisSpot")) then
  349. table.insert(Spots,p)
  350. end
  351. end
  352.  
  353. coroutine.resume(coroutine.create(function()
  354. for i = 1,math.huge do
  355. wait(1)
  356. if (strength.Value < 100) then
  357. strength.Value = strength.Value + 1
  358. end
  359. if (strength.Value > 100) then
  360. strength.Value = 100
  361. end
  362. if (strength.Value > 60) then
  363. dead = false
  364. cent.Cloister:stop()
  365. e1.Base.Cloister:stop()
  366. for i,p in pairs(e1:children()) do
  367. if (p:findFirstChild("Smoke") ~= nil) then
  368. p.Smoke.Enabled = false
  369. end
  370. if (p:findFirstChild("Fire") ~= nil) then
  371. p.Fire.Enabled = false
  372. end
  373. end
  374. end
  375. end
  376. end))
  377.  
  378.  
  379.  
  380. function MakePart(x,y,z,trans,nam,colornam)
  381. local p = Instance.new("Part")
  382. p.Name = nam
  383. p.Transparency = trans
  384. p.TopSurface = "Smooth"
  385. p.BottomSurface = "Smooth"
  386. p.formFactor = "Symmetric"
  387. p.Size = Vector3.new(x,y,z)
  388. p.BrickColor = BrickColor.new(colornam)
  389. p.Anchored = true
  390. return p end
  391.  
  392. function IsoMatch(nam)
  393. for i,p in pairs(users) do
  394. if (p == nam) then return true end
  395. end
  396. return false end
  397.  
  398. function Push()
  399. if (not Windy) then return end
  400. for i,p in pairs(game.Players:children()) do
  401. if (p.Character ~= nil) and (p.Character:findFirstChild("Torso")) and ((p.Character.Torso.Position - base.Position).magnitude < 30) then
  402. local chance = math.random(1,5)
  403. if (chance == 1) then
  404. p.Character.Humanoid.Sit = true
  405. end
  406. end
  407. p.Character.Torso.Velocity = p.Character.Torso.Velocity + (CFrame.new(base.Position,p.Character.Torso.Position).lookVector * 2)
  408. end
  409. end
  410.  
  411. function Teleport(PhOut,PhIn,cf)
  412. if (PhOut) then
  413. cent.Rotor:stop()
  414. e1.Base.Rotor:stop()
  415. cent.Hum:stop()
  416. e1.Base.Hum:stop()
  417. cent.Land:play()
  418. e1.Base.Land:play()
  419. Phase(false)
  420. end
  421. for i,p in pairs(e1:children()) do
  422. p.Transparency = 1
  423. end
  424. --[[for i,p in pairs(game.Players:children()) do
  425. if (p.Character ~= nil) and (p.Character:findFirstChild("Torso")) and ((p.Character.Torso.Position - base.Position).magnitude < 15) then
  426. p.Character.Torso.CFrame = p.Character.Torso.CFrame + (cf - base.Position)
  427. end
  428. end]]
  429. for i,p in pairs(e1:children()) do
  430. if (p ~= base) then
  431. p.CFrame = p.CFrame + (cf - base.Position)
  432. end
  433. end
  434. base.CFrame = base.CFrame + (cf - base.Position)
  435. if (PhIn) then
  436. Phase(true)
  437. end
  438. for i,p in pairs(e1:children()) do
  439. p.Transparency = 0
  440. end
  441. wait(0.5)
  442. cent.Hum:play()
  443. e1.Base.Hum:play()
  444. e1.Teleport.CanCollide = false
  445. e1.LSide.CanCollide = false
  446. e1.Inside.CanCollide = false
  447. e1.RSide.CanCollide = false
  448. e1.Top.CanCollide = false
  449. e1.Floor.CanCollide = false
  450. end
  451.  
  452. function Phase(arriving)
  453. phase = true
  454. e1.LSide.Transparency = 5
  455. e1.Inside.Transparency = 5
  456. e1.RSide.Transparency = 5
  457. e1.Top.Transparency = 5
  458. e1.Floor.Transparency = 5
  459. if (arriving) then
  460. t = -0.1
  461. t2 = 0
  462. else
  463. t = 0.1
  464. t2 = 1
  465. end
  466. wait(0.5)
  467. for i,p in pairs(e1:children()) do
  468. table.insert(Materials,p.Material)
  469. table.insert(matParts,p)
  470. p.Material = "Plastic"
  471. end
  472. for i,p in pairs(e1:children()) do
  473. for x,z in pairs(p:children()) do
  474. if (z.className == "Decal") or (z.className == "Texture") then
  475. table.insert(Decals,z)
  476. z.Parent = nil
  477. table.insert(decalParts,p)
  478. end
  479. end
  480. end
  481. local lights = {}
  482. for i,p in pairs(e1:children()) do
  483. if (p.Name == "Light") then
  484. local flash = MakePart(1,1,1,0,"Flash",tostring(p.BrickColor))
  485. flash.Anchored = false
  486. flash.CanCollide = false
  487. local m = Instance.new("SpecialMesh")
  488. m.MeshType = "Sphere"
  489. m.Parent = flash
  490. flash.Parent = main
  491. local w = Instance.new("Weld")
  492. w.Part0 = p
  493. w.Part1 = flash
  494. w.Parent = game.JointsService
  495. table.insert(lights,flash)
  496. end
  497. end
  498. print("Beginning phase")
  499. cent.Rotor:stop()
  500. e1.Base.Rotor:stop()
  501. cent.Hum:stop()
  502. e1.Base.Hum:stop()
  503. cent.Land:play()
  504. e1.Base.Land:play()
  505. for i = 1,3 do
  506. Push()
  507. wait(0.2)
  508. for i,p in pairs(lights) do
  509. p.Mesh.Scale = p.Mesh.Scale + Vector3.new(10,10,10)
  510. end
  511. for i,p in pairs(e1:children()) do
  512. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  513. p.Transparency = p.Transparency + t
  514. end
  515. end
  516. end
  517. for i = 1,3 do
  518. wait(0.3)
  519. for i,p in pairs(lights) do
  520. p.Mesh.Scale = p.Mesh.Scale - Vector3.new(5,5,5)
  521. end
  522. end
  523. print("Phase complete")
  524. print("Beginning phase")
  525. for i = 1,3 do
  526. Push()
  527. wait(0.2)
  528. for i,p in pairs(lights) do
  529. p.Mesh.Scale = p.Mesh.Scale + Vector3.new(5,5,5)
  530. end
  531. for i,p in pairs(e1:children()) do
  532. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  533. p.Transparency = p.Transparency + t
  534. end
  535. end
  536. end
  537. for i = 1,3 do
  538. wait(0.3)
  539. for i,p in pairs(lights) do
  540. p.Mesh.Scale = p.Mesh.Scale - Vector3.new(5,5,5)
  541. end
  542. end
  543. print("Phase complete")
  544. print("Beginning phase")
  545. for i = 1,3 do
  546. Push()
  547. wait(0.2)
  548. for i,p in pairs(lights) do
  549. p.Mesh.Scale = p.Mesh.Scale + Vector3.new(5,5,5)
  550. end
  551. for i,p in pairs(e1:children()) do
  552. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  553. p.Transparency = p.Transparency + t
  554. end
  555. end
  556. end
  557. for i = 1,3 do
  558. wait(0.3)
  559. for i,p in pairs(lights) do
  560. p.Mesh.Scale = p.Mesh.Scale - Vector3.new(5,5,5)
  561. end
  562. end
  563. print("Phase complete")
  564. for i,p in pairs(e1:children()) do
  565. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  566. p.Transparency = t2
  567. end
  568. end
  569. for i,p in pairs(lights) do p:Remove() end
  570. if (not arriving) then
  571. for i,p in pairs(e1:children()) do
  572. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  573. p.BrickColor = BrickColor.new("White")
  574. end
  575. end
  576. for i = 1,4 do
  577. Push()
  578. wait(0.2)
  579. for i,p in pairs(e1:children()) do
  580. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  581. p.Transparency = p.Transparency - t/1.5
  582. end
  583. end
  584. end
  585. local FormerPosition = base.Position
  586. coroutine.resume(coroutine.create(function()
  587. for a = 1,math.random(2,4) do
  588. wait(0.75)
  589. for b = 1,4 do
  590. PlaySound(22919513,FormerPosition,(0.6 - ((b/10)*1.5)),30,1.5)
  591. wait(0.3)
  592. end
  593. end
  594. end))
  595. end
  596. for i = 1,4 do
  597. Push()
  598. wait(0.2)
  599. for i,p in pairs(e1:children()) do
  600. if (string.find(p.className, "Part")) or (string.find(p.className, "Seat")) then
  601. p.Transparency = p.Transparency + t/1.5
  602. end
  603. end
  604. end
  605. for i,p in pairs(EntryParts) do
  606. p.Transparency = t2
  607. p.BrickColor = EntryColors[i]
  608. end
  609. for i,p in pairs(decalParts) do
  610. Decals[i].Parent = p
  611. end
  612. Decals = {}
  613. decalParts = {}
  614. for i,p in pairs(matParts) do
  615. p.Material = Materials[i]
  616. end
  617. Materials = {}
  618. matParts = {}
  619. phase = false
  620. end
  621.  
  622. go.ClickDetector.MouseClick:connect(function()
  623. if (Starter.Value == true) then
  624. Starter.Value = false
  625. end
  626. if (Starter.Value == false) then
  627. Starter.Value = true
  628. end
  629. end)
  630.  
  631. Starter.Changed:connect(function()
  632. if (work.Value) or (time.Value) or (fuse.Value) or (fly.Value) or (shield.Value) or (open.Value) or (dead) then return end
  633. main.SpinSpeed.Value = 0
  634. time.Value = true
  635. work.Value = true
  636. cent.Land.Volume = 0
  637. cent.Warp:play()
  638. e1.Base.Land.Volume = 0
  639. e1.Base.Warp:play()
  640. local vortpos = Vector3.new(math.random(-800,800),10000,math.random(-800,800))
  641. vp1 = MakePart(1,1,1,0,"VortexMain","Really black")
  642. main.VortMesh:clone().Parent = vp1
  643. vp1.Parent = main
  644. vp1.CFrame = CFrame.new(vortpos) + Vector3.new(0,3.5,0)
  645. vp2 = MakePart(1,1,1,0,"VortexCap", "Really black")
  646. main.CapMesh:clone().Parent = vp2
  647. vp2.Parent = main
  648. vp2.CFrame = vp1.CFrame * CFrame.new(0,0,80)
  649. vp3 = MakePart(1,1,1,0,"VortexCap", "Really black")
  650. main.CapMesh:clone().Parent = vp3
  651. vp3.Parent = main
  652. vp3.CFrame = vp1.CFrame * CFrame.new(0,0,-80)
  653. coroutine.resume(coroutine.create(function()
  654. repeat
  655. wait(math.random(1,5))
  656. local lightning = MakePart(1,1,300,0.25,"Lightning","White")
  657. lightning.Parent = vp1
  658. lightning.CFrame = CFrame.new(vp1.Position + Vector3.new(0,0,math.random(-50,50)),(vp1.Position + Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))))
  659. vp1.BrickColor = BrickColor.new("White")
  660. if (vp2.BrickColor ~= BrickColor.new("Sand green")) then
  661. vp2.BrickColor = BrickColor.new("White")
  662. end
  663. vp3.BrickColor = BrickColor.new("White")
  664. wait(0.25)
  665. lightning:Remove()
  666. vp1.BrickColor = BrickColor.new("Really black")
  667. if (vp2.BrickColor ~= BrickColor.new("Sand green")) then
  668. vp2.BrickColor = BrickColor.new("Really black")
  669. end
  670. vp3.BrickColor = BrickColor.new("Really black")
  671. until (vp2.BrickColor == BrickColor.new("Sand green"))
  672. end))
  673. Teleport(true,false,vortpos)
  674. local flightpos = base.Position
  675. tbg = Instance.new("BodyGyro")
  676. tbg.Name = "StayUp"
  677. tbg.Parent = e1.Base
  678. tbg.maxTorque = Vector3.new(500,0,500)
  679. tba = Instance.new("BodyAngularVelocity")
  680. tba.Name = "Spin"
  681. tba.Parent = e1.Base
  682. cent.Hum:play()
  683. e1.Base.Hum:play()
  684. e1.Base.Land.Volume = 1
  685. e1.Base.Rotor:play()
  686. cent.Land.Volume = 1
  687. cent.Rotor:play()
  688. tba.angularvelocity = Vector3.new(0,0,0)
  689. tba.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  690. coroutine.resume(coroutine.create(function()
  691. repeat
  692. if (math.abs(tba.angularvelocity.Y) > 10) then
  693. for i = 1,5 do
  694. wait(0.1)
  695. tba.angularvelocity = tba.angularvelocity * 0.9
  696. end
  697. else
  698. tba.angularvelocity = tba.angularvelocity + Vector3.new(0,math.random(-5,5)/10,0)
  699. end
  700. wait(0.1)
  701. --[[for i,p in pairs(game.Players:children()) do
  702. if (p.Character ~= nil) and (p.Character:findFirstChild("Torso")) and ((p.Character.Torso.Position - vp1.Position).magnitude < 50) then
  703. p.Character.Humanoid.Health = p.Character.Humanoid.Health - 1
  704. end
  705. end]]
  706. until (tba == nil)
  707. end))
  708. tbv = Instance.new("BodyPosition")
  709. tbv.Name = "Hover"
  710. tbv.Parent = e1.Base
  711. tbv.position = e1.Base.Position
  712. tbv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  713. coroutine.resume(coroutine.create(function()
  714. repeat
  715. for i = 1,10 do
  716. tbv.position = vp1.Position + Vector3.new(i,0,0)
  717. wait(0.1)
  718. end
  719. wait(1)
  720. for i = 1,20 do
  721. tbv.position = vp1.Position + Vector3.new((10-i),0,0)
  722. wait(0.1)
  723. end
  724. wait(1)
  725. for i = 1,10 do
  726. tbv.position = vp1.Position + Vector3.new(-(10-i),0,0)
  727. wait(0.1)
  728. end
  729. until (vp2.BrickColor == BrickColor.new("Sand green"))
  730. tbv.position = vp1.Position
  731. end))
  732. wait(0.5)
  733. work.Value = false
  734. end)
  735. workspace.DescendantAdded:connect(function(obj)
  736. if (obj.className == "Explosion") then
  737. if ((obj.Position - e1.Teleport.Position).magnitude < ((obj.BlastRadius/2)+7)) and (e1:findFirstChild("TARDISFF") == nil) then
  738. print("A TARDIS got hit by an explosion.")
  739. if (strength.Value > 0) then
  740. strength.Value = strength.Value - 25
  741. end
  742. if (strength.Value < 0) then
  743. strength.Value = 0
  744. end
  745. if (strength.Value == 0) then
  746. dead = true
  747. end
  748. if (strength.Value < 10) then
  749. cent.Cloister:play()
  750. e1.Base.Cloister:play()
  751. print("Ding! Ding! Cloister bell!")
  752. for i,p in pairs(e1:children()) do
  753. if (p:findFirstChild("Smoke") ~= nil) then
  754. p.Smoke.Enabled = true
  755. end
  756. if (p:findFirstChild("Fire") ~= nil) then
  757. p.Fire.Enabled = true
  758. end
  759. end
  760. end
  761. if (time.Value) and (dead) then
  762. work.Value = false
  763. local spot = Spots[math.random(1,#Spots)]
  764. if (spot) then
  765. e1.Parent = full
  766. pos = e1.Base.Position
  767. for i,p in pairs(e1:children()) do
  768. p.Transparency = 0
  769. if (p ~= base) then
  770. p.CFrame = p.CFrame + (pos - base.Position)
  771. end
  772. end
  773. base.CFrame = base.CFrame + (pos - base.Position)
  774. vp2.BrickColor = BrickColor.new("Sand green")
  775. local vpF = MakePart(1,1,1,0,"Flame Vortex","Sand green")
  776. main.FlameMesh:clone().Parent = vpF
  777. vpF.CFrame = vp1.CFrame * CFrame.new(0,0,160)
  778. vpF.Parent = main
  779. coroutine.resume(coroutine.create(function()
  780. wait(2)
  781. if (RandomPosition) then
  782. Teleport(false,true,spot.Position + Vector3.new(math.random(-Offset,Offset),0,math.random(-Offset,Offset)))
  783. else
  784. Teleport(false,true,spot.Position)
  785. end
  786. end))
  787. for i = 1,160 do
  788. vpF.CFrame = vpF.CFrame * CFrame.new(0,0,-1)
  789. wait(0.01)
  790. end
  791. vp3.BrickColor = BrickColor.new("Sand green")
  792. wait(3)
  793. vp1:Remove()
  794. vp2:Remove()
  795. vp3:Remove()
  796. vpF:Remove()
  797. time.Value = false
  798. work.Value = false
  799. cent.Rotor:stop()
  800. e1.Base.Rotor:stop()
  801. end
  802. end
  803. if (fly.Value) and (dead) then
  804. for i,p in pairs(e1.Base:children()) do
  805. if (not string.find(p.className, "Mesh")) then
  806. p:Remove()
  807. end
  808. end
  809. end
  810. end
  811. end
  812. end)
  813. Starter.Changed:connect(function()
  814. local TelePos = nil
  815. if (not time.Value) or (work.Value) or (fuse.Value) or (fly.Value) or (shield.Value) or (open.Value) then return end
  816. main.SpinSpeed.Value = 3
  817. if (vectorV.Value == 1) then
  818. local spot = workspace:findFirstChild("TardisSpot" ..placel.Value.. "-" ..timel.Value)
  819. if (spot) then
  820. TelePos = spot.Position
  821. end
  822. else
  823. local x = tonumber(main.X.Value)
  824. local y = tonumber(main.Y.Value)
  825. local z = tonumber(main.Z.Value)
  826. if (x) and (y) and (z) then
  827. TelePos = Vector3.new(x,y,z)
  828. end
  829. end
  830. if (TelePos ~= nil) then
  831. work.Value = true
  832. for i,p in pairs(e1:children()) do
  833. p.Transparency = 0
  834. end
  835. vp2.BrickColor = BrickColor.new("Sand green")
  836. local vpF = MakePart(1,1,1,0,"Flame Vortex","Sand green")
  837. main.FlameMesh:clone().Parent = vpF
  838. vpF.CFrame = vp1.CFrame * CFrame.new(0,0,160)
  839. vpF.Parent = main
  840. for i = 1,160 do
  841. vpF.CFrame = vpF.CFrame * CFrame.new(0,0,-1)
  842. wait(0.01)
  843. end
  844. vp3.BrickColor = BrickColor.new("Sand green")
  845. wait(1)
  846. tbg:Remove()
  847. tba:Remove()
  848. tbv:Remove()
  849. if (RandomPosition) then
  850. Teleport(false,true,TelePos + Vector3.new(math.random(-Offset,Offset),0,math.random(-Offset,Offset)))
  851. else
  852. Teleport(false,true,TelePos)
  853. end
  854. wait(0.5)
  855. vp1:Remove()
  856. vp2:Remove()
  857. vp3:Remove()
  858. vpF:Remove()
  859. time.Value = false
  860. cent.Rotor:stop()
  861. base.Rotor:stop()
  862. wait(0.5)
  863. work.Value = false
  864. end
  865. end)
  866.  
  867. function Begin(weld)
  868. if (weld.className == "Weld") and ((IsoMatch(weld.Part1.Parent.Name)) or (not Isomorphic)) then
  869. local person = game.Players:findFirstChild(weld.Part1.Parent.Name)
  870. if (person) then player = person; guy = player.Character end
  871. nav = "Spots"
  872. seat.ChildRemoved:connect(End)
  873. gui = main.FlightGUI:clone()
  874. gui.Parent = player.PlayerGui
  875. tool = main.TardisCam:clone()
  876. tool.CamTarget.Value = e1.Base
  877. tool.Parent = player.Backpack
  878. tool2 = main.TardisLaser:clone()
  879. tool2.Origin.Value = full
  880. tool2.Parent = player.Backpack
  881. gmain = gui.Main
  882. gmain.SpnSpd.Text = "Spinning speed is " ..main.SpinSpeed.Value
  883. gmain.SpeedUp.MouseButton1Click:connect(function()
  884. if (main.SpinSpeed.Value < 5) then
  885. main.SpinSpeed.Value = main.SpinSpeed.Value + 1
  886. end
  887. gmain.SpnSpd.Text = "Spinning speed is " ..main.SpinSpeed.Value
  888. end)
  889. gmain.SpeedDown.MouseButton1Click:connect(function()
  890. if (main.SpinSpeed.Value > -5) then
  891. main.SpinSpeed.Value = main.SpinSpeed.Value - 1
  892. end
  893. gmain.SpnSpd.Text = "Spinning speed is " ..main.SpinSpeed.Value
  894. end)
  895.  
  896. gmain.Stable.MouseButton1Click:connect(function()
  897. if (base:findFirstChild("BlueGyro")) then
  898. base.BlueGyro:Remove()
  899. else
  900. local blg = Instance.new("BodyGyro")
  901. blg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  902. blg.Parent = base
  903. blg.Name = "BlueGyro"
  904. end
  905. end)
  906. gmain.LockButton.MouseButton1Click:connect(function()
  907. if (work.Value) or (shield.Value) or (time.Value) or (locked.Value) or (fuse.Value) then return end
  908. if (open.Value) then
  909. open.Value = false
  910. e1.Base.Hum.Volume = 0
  911. for i,p in pairs(e1:children()) do
  912. if (p.Name == "DoorPart") then
  913. p.Transparency = 0
  914. p.CanCollide = true
  915. end
  916. end
  917. for i,p in pairs(e1:children()) do
  918. if (p.Name == "LabelPart") then
  919. p.Mesh.MeshType = "Brick"
  920. p.CanCollide = true
  921. end
  922. end
  923. for i,p in pairs(TBase:children()) do
  924. if (p.Name == "DoorPart") then
  925. p.Part1.Transparency = 0
  926. p.Part1.CanCollide = true
  927. end
  928. end
  929. else
  930. open.Value = true
  931. e1.Base.Hum.Volume = 0.75
  932. for i,p in pairs(e1:children()) do
  933. if (p.Name == "DoorPart") then
  934. p.Transparency = 1
  935. p.CanCollide = false
  936. end
  937. end
  938. for i,p in pairs(e1:children()) do
  939. if (p.Name == "LabelPart") then
  940. p.Mesh.MeshType = "FileMesh"
  941. p.CanCollide = false
  942. end
  943. end
  944. for i,p in pairs(TBase:children()) do
  945. if (p.Name == "DoorPart") then
  946. p.Part1.Transparency = 1
  947. p.Part1.CanCollide = false
  948. end
  949. end
  950. end
  951. end)
  952. gmain.FlightStart.MouseButton1Click:connect(ManageFlight)
  953. gmain.Stop.MouseButton1Click:connect(function()
  954. if (fly.Value) then
  955. e1.Base.Fly.velocity = Vector3.new(0,0,0)
  956. end
  957. end)
  958. gmain.East.MouseButton1Click:connect(function()
  959. if (fly.Value) then
  960. e1.Base.Fly.velocity = Vector3.new(-15,0,0)
  961. end
  962. end)
  963. gmain.West.MouseButton1Click:connect(function()
  964. if (fly.Value) then
  965. e1.Base.Fly.velocity = Vector3.new(15,0,0)
  966. end
  967. end)
  968. gmain.North.MouseButton1Click:connect(function()
  969. if (fly.Value) then
  970. e1.Base.Fly.velocity = Vector3.new(0,0,15)
  971. end
  972. end)
  973. gmain.South.MouseButton1Click:connect(function()
  974. if (fly.Value) then
  975. e1.Base.Fly.velocity = Vector3.new(0,0,-15)
  976. end
  977. end)
  978. gmain.Up.MouseButton1Click:connect(function()
  979. if (fly.Value) then
  980. e1.Base.Fly.velocity = Vector3.new(0,15,0)
  981. end
  982. end)
  983. gmain.Down.MouseButton1Click:connect(function()
  984. if (fly.Value) then
  985. e1.Base.Fly.velocity = Vector3.new(0,-15,0)
  986. end
  987. end)
  988. end
  989. end
  990.  
  991. function ManageFlight()
  992. if (not fly.Value) and (not work.Value) and (not fuse.Value) and (not dead) then
  993. work.Value = true
  994. fly.Value = true
  995. cent.Rotor:play()
  996. e1.Base.Rotor:play()
  997. local flightpos = base.Position
  998. local fba = Instance.new("BodyAngularVelocity")
  999. fba.Name = "Spin"
  1000. fba.Parent = e1.Base
  1001. fba.angularvelocity = Vector3.new(0,0,0)
  1002. fba.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  1003. coroutine.resume(coroutine.create(function()
  1004. repeat
  1005. wait(0.1)
  1006. fba.angularvelocity = Vector3.new(0,main.SpinSpeed.Value,0)
  1007. until (fba == nil)
  1008. end))
  1009. fbv = Instance.new("BodyVelocity")
  1010. fbv.Name = "Fly"
  1011. fbv.Parent = e1.Base
  1012. fbv.velocity = Vector3.new(0,0,0)
  1013. fbv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  1014. work.Value = false
  1015. elseif (not work.Value) and (not dead) then
  1016. e1.Base.Spin:Remove()
  1017. fbv:Remove()
  1018. fly.Value = false
  1019. cent.Rotor:stop()
  1020. e1.Base.Rotor:stop()
  1021. end
  1022. end
  1023.  
  1024. function End(weld)
  1025. if (weld.className == "Weld") then
  1026. wait(0.5)
  1027. gui:Remove()
  1028. gui = nil
  1029. tool:Remove()
  1030. tool = nil
  1031. tool2:Remove()
  1032. tool2 = nil
  1033. guy = nil
  1034. player = nil
  1035. end
  1036. end
  1037. seat.ChildAdded:connect(Begin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement