Advertisement
Dinosaurus

[R] Owner Script

Jun 20th, 2016
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.40 KB | None | 0 0
  1. -- Hellu, this is FlySheep Script maded mostly by damko00 to create a
  2. -- Script Builder Sheep, that you can fly
  3. -- Just paste your name intro line 13 and 508
  4.  
  5. --[[CONTROLS:
  6.  
  7. Y - Start Flying + Speed Up
  8. X - Stop Flying
  9. F - Shot a Colorful Vomit
  10. S - Slow Down]]
  11.  
  12.  
  13. name = "DDB_Dex"
  14. plr = game.Players[DBB_Dex]
  15. char = plr.Character
  16. prim = BrickColor.new("Lime green") -- PRIMARY COLOR
  17. seco = BrickColor.new("Really red") --SECONDARY COLOR
  18. cf = CFrame.new
  19.  
  20. if script.Parent.ClassName ~= "HopperBin" then
  21. local bin = Instance.new("HopperBin",plr.Backpack)
  22. bin.Name = "SheepCraft"
  23. bin.BinType = "Script"
  24. script:clone().Parent = bin
  25. script:remove()
  26. else
  27. bin = script.Parent;
  28.  
  29. sheep = Instance.new("Model", game.Workspace)
  30.  
  31. seat = Instance.new("Seat", sheep)
  32. seat.Name = "AircraftSeat"
  33. seat.BrickColor = prim
  34. seat.TopSurface = 0
  35. seat.BottomSurface = 0
  36. seat.FormFactor = 0
  37. seat.Material = "Concrete"
  38. seat.Size = Vector3.new(4,2,4)
  39. seat.Position = char.Torso.Position
  40. seat.Name = "AircraftSeat"
  41.  
  42. m = Instance.new("SpecialMesh", seat)
  43. m.Scale = Vector3.new(1,1.5,1.75)
  44. m.MeshType = "Sphere"
  45.  
  46. head = Instance.new("Part", sheep)
  47. head.Size = Vector3.new(4,2,2)
  48. head.FormFactor = 0
  49. head.BrickColor = seco
  50.  
  51. m = Instance.new("SpecialMesh", head)
  52.  
  53. d = Instance.new("Decal", head)
  54. d.Texture = "http://www.roblox.com/asset/?id=113475009"
  55. d.Face = "Front"
  56.  
  57. APart = Instance.new("Part")
  58. APart.Transparency = 1
  59. APart.CanCollide = false
  60. APart.Size = Vector3.new(1,1,1)
  61. APart.Parent = sheep
  62.  
  63. function weld(p0, p1, c1)
  64. weld = Instance.new("Weld", sheep)
  65. weld.Part0 = p0
  66. weld.Part1 = p1
  67. weld.C1 = c1
  68. end
  69.  
  70. weld(head, APart, cf(0, 0, 1.5))
  71.  
  72. function weld(p0, p1, c1)
  73. weld = Instance.new("Weld", sheep)
  74. weld.Part0 = p0
  75. weld.Part1 = p1
  76. weld.C1 = c1
  77. end
  78.  
  79. weld(seat, head, cf(0, -1.5, 3))
  80.  
  81. p = Instance.new("Part", sheep)
  82. p.FormFactor = 0
  83. p.Size = Vector3.new(1,1,1)
  84. p.BrickColor = seco
  85.  
  86. m = Instance.new("SpecialMesh", p)
  87. m.MeshType = "Sphere"
  88. m.Scale = Vector3.new(.4,1,.25)
  89.  
  90. function weld(p0, p1, c1)
  91. weld = Instance.new("Weld", sheep)
  92. weld.Part0 = p0
  93. weld.Part1 = p1
  94. weld.C1 = c1
  95. end
  96.  
  97. weld(head, p, cf(.5, -1,0))
  98.  
  99. p = Instance.new("Part", sheep)
  100. p.FormFactor = 0
  101. p.Size = Vector3.new(1,1,1)
  102. p.BrickColor = seco
  103.  
  104. m = Instance.new("SpecialMesh", p)
  105. m.MeshType = "Sphere"
  106. m.Scale = Vector3.new(.4,1,.25)
  107.  
  108. function weld(p0, p1, c1)
  109. weld = Instance.new("Weld", sheep)
  110. weld.Part0 = p0
  111. weld.Part1 = p1
  112. weld.C1 = c1
  113. end
  114.  
  115. weld(head, p, cf(-.5, -1,0))
  116.  
  117. p = Instance.new("Part", sheep)
  118. p.FormFactor = 0
  119. p.Size = Vector3.new(1,2,1)
  120. p.BrickColor = seco
  121.  
  122. m = Instance.new("SpecialMesh", p)
  123. m.Scale = Vector3.new(.7,1.25,1)
  124.  
  125. function weld(p0, p1, c1)
  126. weld = Instance.new("Weld", sheep)
  127. weld.Part0 = p0
  128. weld.Part1 = p1
  129. weld.C1 = c1
  130. end
  131.  
  132. weld(seat, p, cf(-1.25, 1.5,2))
  133.  
  134. fp = Instance.new("Part", sheep)
  135. fp.FormFactor = 0
  136. fp.Size = Vector3.new(1,2,1)
  137. fp.Transparency = 1
  138.  
  139. f = Instance.new("Fire", fp)
  140. f.Size = 2
  141. f.Heat = -5
  142. f.Color = Color3.new(1,1,1)
  143. f.SecondaryColor = f.Color
  144.  
  145. function weld(p0, p1, c1)
  146. weld = Instance.new("Weld", sheep)
  147. weld.Part0 = p0
  148. weld.Part1 = p1
  149. weld.C1 = c1
  150. end
  151.  
  152. weld(p, fp, cf(0, 1.1,0))
  153.  
  154. p = Instance.new("Part", sheep)
  155. p.FormFactor = 0
  156. p.Size = Vector3.new(1,2,1)
  157. p.BrickColor = seco
  158.  
  159. m = Instance.new("SpecialMesh", p)
  160. m.Scale = Vector3.new(.7,1.25,1)
  161.  
  162. function weld(p0, p1, c1)
  163. weld = Instance.new("Weld", sheep)
  164. weld.Part0 = p0
  165. weld.Part1 = p1
  166. weld.C1 = c1
  167. end
  168.  
  169. weld(seat, p, cf(1.25, 1.5,2))
  170.  
  171. fp = Instance.new("Part", sheep)
  172. fp.FormFactor = 0
  173. fp.Size = Vector3.new(1,2,1)
  174. fp.Transparency = 1
  175.  
  176. f = Instance.new("Fire", fp)
  177. f.Color = Color3.new(1,1,1)
  178. f.Size = 2
  179. f.Heat = -5
  180. f.SecondaryColor = f.Color
  181.  
  182. function weld(p0, p1, c1)
  183. weld = Instance.new("Weld", sheep)
  184. weld.Part0 = p0
  185. weld.Part1 = p1
  186. weld.C1 = c1
  187. end
  188.  
  189. weld(p, fp, cf(0, 1.1,0))
  190.  
  191. p = Instance.new("Part", sheep)
  192. p.FormFactor = 0
  193. p.Size = Vector3.new(1,2,1)
  194. p.BrickColor = seco
  195.  
  196. m = Instance.new("SpecialMesh", p)
  197. m.Scale = Vector3.new(.7,1.25,1)
  198.  
  199. function weld(p0, p1, c1)
  200. weld = Instance.new("Weld", sheep)
  201. weld.Part0 = p0
  202. weld.Part1 = p1
  203. weld.C1 = c1
  204. end
  205.  
  206. weld(seat, p, cf(-1.25, 1.5,-1.5))
  207.  
  208. fp = Instance.new("Part", sheep)
  209. fp.FormFactor = 0
  210. fp.Size = Vector3.new(1,2,1)
  211. fp.Transparency = 1
  212.  
  213. f = Instance.new("Fire", fp)
  214. f.Size = 2
  215. f.Heat = -5
  216. f.Color = Color3.new(1,1,1)
  217. f.SecondaryColor = f.Color
  218.  
  219. function weld(p0, p1, c1)
  220. weld = Instance.new("Weld", sheep)
  221. weld.Part0 = p0
  222. weld.Part1 = p1
  223. weld.C1 = c1
  224. end
  225.  
  226. weld(p, fp, cf(0, 1.1,0))
  227.  
  228. p = Instance.new("Part", sheep)
  229. p.FormFactor = 0
  230. p.Size = Vector3.new(1,2,1)
  231. p.BrickColor = seco
  232.  
  233. m = Instance.new("SpecialMesh", p)
  234. m.Scale = Vector3.new(.7,1.25,1)
  235.  
  236. function weld(p0, p1, c1)
  237. weld = Instance.new("Weld", sheep)
  238. weld.Part0 = p0
  239. weld.Part1 = p1
  240. weld.C1 = c1
  241. end
  242.  
  243. weld(seat, p, cf(1.25, 1.5,-1.5))
  244.  
  245. fp = Instance.new("Part", sheep)
  246. fp.FormFactor = 0
  247. fp.Size = Vector3.new(1,2,1)
  248. fp.Transparency = 1
  249.  
  250. f = Instance.new("Fire", fp)
  251. f.Color = Color3.new(1,1,1)
  252. f.Size = 2
  253. f.Heat = -5
  254. f.SecondaryColor = f.Color
  255.  
  256. function weld(p0, p1, c1)
  257. weld = Instance.new("Weld", sheep)
  258. weld.Part0 = p0
  259. weld.Part1 = p1
  260. weld.C1 = c1
  261. end
  262.  
  263. weld(p, fp, cf(0, 1.1,0))
  264.  
  265. ac = Instance.new("IntValue", seat)
  266. ac.Value = 100
  267. ac.Name = "Acceleration"
  268.  
  269. lc = Instance.new("IntValue", seat)
  270. lc.Value = 23
  271. lc.Name = "LiftTrim"
  272.  
  273. mac = Instance.new("IntValue", seat)
  274. mac.Value = 1000
  275. mac.Name = "MaxSpeed"
  276.  
  277. sc = Instance.new("IntValue", seat)
  278. sc.Value = 100
  279. sc.Name = "Speed"
  280.  
  281. tc = Instance.new("IntValue", seat)
  282. tc.Value = 40
  283. tc.Name = "TiltFactor"
  284.  
  285. ts = Instance.new("IntValue", seat)
  286. ts.Value = 1000
  287. ts.Name = "TurnSpeed"
  288.  
  289. dir = Instance.new("BodyGyro", seat)
  290. dir.maxTorque = Vector3.new(0,0,0)
  291. dir.D = 500
  292. dir.P = 1000
  293. dir.Name = "Direction"
  294.  
  295. thu = Instance.new("BodyVelocity", seat)
  296. thu.maxForce = Vector3.new(0,0,0)
  297. thu.velocity = Vector3.new(0,0.16,-100)
  298. thu.P = 1250
  299. thu.Name = "Thrust"
  300.  
  301. orv = Instance.new("CFrameValue", seat)
  302. orv.Value = seat.CFrame
  303. orv.Name = "OriginCFrame"
  304.  
  305. sheep:MoveTo(char.Head.Position)
  306. seat.Parent = char
  307.  
  308. bin = script.Parent
  309. plane = nil
  310. hold = false
  311. local debounce = false
  312. local planedebounce = false
  313. local stuntdebounce = false
  314. local controlling = false
  315. local currentspeed = 0
  316. local turn = nil
  317. fly = false
  318.  
  319. function computeDirection(vec)
  320. local lenSquared = vec.magnitude * vec.magnitude
  321. local invSqrt = 1 / math.sqrt(lenSquared)
  322. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  323. end
  324.  
  325. function move(point, engine)
  326. local origincframe = engine:findFirstChild("Direction").cframe
  327. size = engine.Size
  328.  
  329. target = engine.Position+((point - engine.Position).unit*100)
  330. local dir = (target - engine.Position).unit
  331. local spawnPos = engine.Position
  332. left = engine.CFrame*CFrame.new(-size.x/2, 0, 0).p
  333. right = engine.CFrame*CFrame.new(size.x/2, 0, 0).p
  334. md = (target - engine.Position).magnitude
  335.  
  336. foebmd = engine.CFrame*CFrame.new(0, 0, -md).p
  337. toleft = (target -left).magnitude
  338. toright = (target -right).magnitude
  339. rot = ((foebmd - target).magnitude/10)
  340. local pos = spawnPos + (dir * 1)
  341. turn = math.rad((rot/10)*engine.TiltFactor.Value)
  342. if turn > math.rad(89) then
  343. turn = math.rad(89)
  344. end
  345. if toleft< toright and toleft >rot then
  346. engine:findFirstChild("Direction").cframe = CFrame.new(pos, pos + dir)*CFrame.fromEulerAnglesXYZ(0, 0, turn)
  347. elseif toleft > toright and toright >rot then
  348. engine:findFirstChild("Direction").cframe = CFrame.new(pos, pos + dir)*CFrame.fromEulerAnglesXYZ(0, 0, -turn)
  349. else
  350. engine:findFirstChild("Direction").cframe = CFrame.new(pos, pos + dir)
  351. end
  352. engine:findFirstChild("Direction").P = engine.TurnSpeed.Value
  353. end
  354.  
  355. function findPlane(player)
  356. local list = player.Character:GetChildren()
  357. for x = 1, #list do
  358. if (list[x].Name == "AircraftSeat") then
  359. return list[x]
  360. end
  361. end
  362. return nil
  363. end
  364.  
  365. function onButton1Down(mouse)
  366. local vehicle = findPlane(plr)
  367. if vehicle ~= nil and debounce == false and planedebounce == false then
  368. if fly == false and taxi == false then return end
  369. debounce = true
  370.  
  371. controlling = true
  372.  
  373. while true do
  374. wait()
  375. local engine = vehicle
  376. local position = mouse.Hit
  377. local target = position.p
  378. move(target, engine)
  379. if planedebounce == true or
  380. controlling == false then break end
  381. end
  382. wait(0.1)
  383. debounce = false
  384. end
  385. end
  386.  
  387. function onButton1Up(mouse)
  388. controlling = false
  389. end
  390.  
  391. function onSelected(mouse)
  392. ShootPos = mouse
  393. mouse.Icon = "http://www.roblox.com/asset/?id=7419350"
  394. game.Workspace.CurrentCamera.CameraSubject = bin.Parent.Parent.Character.Head
  395. game.Workspace.CurrentCamera.CameraType = "Track"
  396. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  397. mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  398. mouse.KeyDown:connect(onKeyDown)
  399. mouse.KeyUp:connect(onKeyUp)
  400. mouse.Move:connect(function() Fly(mouse) end)
  401. mouse.Idle:connect(function() Fly(mouse) end)
  402. end
  403.  
  404. function onDeselected(mouse)
  405. game.Workspace.CurrentCamera.CameraSubject = bin.Parent.Parent.Character.Humanoid
  406. game.Workspace.CurrentCamera.CameraType = "Custom"
  407. end
  408.  
  409. function Fly(mouse)
  410. local vehicle = findPlane(plr)
  411. if (vehicle==nil) then return end
  412. vehicle.Thrust.velocity = (vehicle.CFrame.lookVector * currentspeed) + Vector3.new(0,vehicle.LiftTrim.Value/100,0)
  413. end
  414.  
  415. function onKeyDown(key)
  416. if (key~=nil) then
  417. --key = key:lower()
  418. local vehicle = findPlane(plr)
  419. if (vehicle==nil) then return end
  420. if key == "y" then
  421. fly = true
  422. vehicle.Direction.cframe = vehicle.CFrame
  423. vehicle.Direction.maxTorque = Vector3.new(4e3,4e3,4e3)
  424. vehicle.Thrust.maxForce = Vector3.new(9e20,9e20,9e20)
  425. while fly == true do
  426. if currentspeed < vehicle.Speed.Value then
  427. currentspeed = currentspeed + 1
  428. elseif currentspeed > vehicle.Speed.Value then
  429. currentspeed = currentspeed - 1
  430. end
  431. if vehicle.Acceleration.Value > 1000 then vehicle.Acceleration.Value = 1000 end
  432. wait((1-(vehicle.Acceleration.Value/1000))+0.01)
  433. if fly == false then break end
  434. end
  435. end
  436. if key == "x" then
  437. fly = false
  438. currentspeed = 0
  439. vehicle.Direction.maxTorque = Vector3.new(0,0,0)
  440. vehicle.Thrust.maxForce = Vector3.new(0,0,0)
  441. end
  442. if key == "w" then
  443. if vehicle.Speed.Value < vehicle.MaxSpeed.Value then
  444. vehicle.Speed.Value = vehicle.Speed.Value + 10
  445. end
  446. end
  447. if key == "s" then
  448. if vehicle.Speed.Value > -10 then
  449. vehicle.Speed.Value = vehicle.Speed.Value - 10
  450. end
  451. end
  452. if (key=="'") and (bin.Locked.Value == false) then
  453. local repl = script:clone()
  454. repl.Parent = bin
  455. wait(1)
  456. script:remove()
  457. end
  458. if key == "l" and fly == true then
  459. vehicle.Direction.maxTorque = Vector3.new(4e3,0,4e3)
  460. local frame = vehicle:FindFirstChild("OriginCFrame")
  461. if frame ~= nil then
  462. vehicle.Direction.cframe = frame.Value
  463. end
  464. wait(2)
  465. vehicle.Direction.cframe = vehicle.CFrame
  466. vehicle.Direction.maxTorque = Vector3.new(4e3,4e3,4e3)
  467.  
  468. end
  469. if key == "f" and fly == true then
  470.  
  471. function raycast(origin, ending, ang)
  472. local ray = Ray.new(
  473. origin.p, -- origin
  474. (ending.p - origin.p).unit * 500 -- direction
  475. )
  476. local hit, Position = game.Workspace:FindPartOnRay(ray, ang)
  477. local RayPart = Instance.new("Part", game.Workspace)
  478. RayPart.Name = "RayPart"
  479. RayPart.BrickColor = BrickColor.random()
  480. RayPart.Transparency = 0.5
  481. RayPart.Reflectance = .25
  482. RayPart.Anchored = true
  483. RayPart.CanCollide = false
  484. RayPart.TopSurface = Enum.SurfaceType.Smooth
  485. RayPart.BottomSurface = Enum.SurfaceType.Smooth
  486. RayPart.FormFactor = Enum.FormFactor.Custom
  487. local Distance = (Position-origin.p).magnitude
  488. RayPart.Size = Vector3.new(0.2,0.2,Distance)
  489. RayPart.CFrame = CFrame.new(Position,origin.p) * CFrame.new(0,0,-Distance/2)
  490. game.Debris:AddItem(RayPart,0.2)
  491. exp = Instance.new("Explosion", game.Workspace)
  492. exp.Position = ending.p
  493. exp.BlastRadius = 5
  494. RP = RayPart
  495.  
  496. --[[RP = Instance.new("Part", game.Workspace)
  497. RP.Size = Vector3.new(6,6,6)
  498. RP.Position = ending.p
  499. RP.BrickColor = RayPart.BrickColor
  500. RP.Transparency = .5
  501. RP.Reflectance = .25
  502. RP.Anchored = true
  503. RP.CanCollide = false
  504. RP.TopSurface = 0
  505. RP.BottomSurface = 0
  506. RP.Shape = 0
  507. game.Debris:AddItem(RP, .2) ]]
  508.  
  509. function Tuch(Dhit)
  510. if Dhit.Parent.Name ~= "shadowwolf988" then
  511. h = Dhit.Parent:findFirstChild("Humanoid")
  512. if h then
  513. h:TakeDamage(math.huge) -- Sheep Vomitation of Doom
  514. plajr = game.Players:getPlayerFromCharacter(h.Parent)
  515. if plajr then
  516. g = Instance.new("ScreenGui", plajr.PlayerGui)
  517. l = Instance.new("ImageLabel", g)
  518. l.BackgroundTransparency = 1
  519. l.Position = UDim2.new(.25,0,.15,0)
  520. l.Size = UDim2.new(.5,0,.7,0)
  521. l.Image = "http://www.roblox.com/asset/?id=117305754"
  522. end
  523. end
  524. end
  525. end
  526.  
  527. return hit
  528.  
  529. end
  530. hit = raycast(APart.CFrame, ShootPos.Hit, char)
  531. if (hit) then
  532. exp.Hit:connect(Tuch)
  533. end
  534. end
  535.  
  536. end
  537. end
  538.  
  539. function onKeyUp(key)
  540. if (key~=nil) then
  541. key = key:lower()
  542. local vehicle = findPlane(plr)
  543. if (vehicle==nil) then return end
  544. end
  545. end
  546.  
  547. bin.Selected:connect(onSelected)
  548. bin.Deselected:connect(onDeselected)
  549.  
  550. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement