Advertisement
ItzInfern

flying elevator

Jan 5th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.39 KB | None | 0 0
  1.  
  2.  
  3. --https://github.com/Mokiros/roblox-FE-compatibility
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. local RealPlayer = Player
  7. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  8.  
  9. color1 = "Dark grey"
  10. color2 ="Really black"
  11. me = game.Players.LocalPlayer.Name
  12. lord1 = game.Players[me]
  13. lord2 = lord1.Character
  14. mod = Instance.new("Model")
  15. mod.Parent = lord2
  16. mod.Name = ""..me.."'s Elevator"
  17. hum = Instance.new("Humanoid")
  18. hum.MaxHealth = 0
  19. hum.Parent = mod
  20. eng = Instance.new("SpawnLocation")
  21. eng.Parent = mod
  22. eng.Name = "Head"
  23. eng.Size = Vector3.new(12,1,12)
  24. eng.BrickColor = BrickColor.new(color1)
  25. eng.TopSurface = "Smooth"
  26. eng.BottomSurface = "Smooth"
  27. eng.Position = lord1.Character.Torso.Position + Vector3.new(0,100,0)
  28. control = Instance.new("VehicleSeat")
  29. control.Parent = mod
  30. control.Size = Vector3.new(2,1,2)
  31. control.BrickColor = BrickColor.new("Lime green")
  32. control.TopSurface = "Smooth"
  33. control.BottomSurface = "Smooth"
  34. control:BreakJoints()
  35. weld = Instance.new("Weld")
  36. weld.Parent = eng
  37. weld.Part0 = eng
  38. weld.Part1 = control
  39. weld.C0 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi,0)
  40. s1 = Instance.new("Seat")
  41. s1.Parent = mod
  42. s1.Size = Vector3.new(2,1,2)
  43. s1.BrickColor = BrickColor.new(color2)
  44. s1.BottomSurface = "Smooth"
  45. s1:BreakJoints()
  46. weld = Instance.new("Weld")
  47. weld.Parent = eng
  48. weld.Part0 = eng
  49. weld.Part1 = s1
  50. weld.C0 = CFrame.new(5,1,5) * CFrame.Angles(0,math.pi,0)
  51. s2 = Instance.new("Seat")
  52. s2.Parent = mod
  53. s2.Size = Vector3.new(2,1,2)
  54. s2.BrickColor = BrickColor.new(color2)
  55. s2.BottomSurface = "Smooth"
  56. s2:BreakJoints()
  57. weld = Instance.new("Weld")
  58. weld.Parent = eng
  59. weld.Part0 = eng
  60. weld.Part1 = s2
  61. weld.C0 = CFrame.new(5,1,-5) * CFrame.Angles(0,math.pi,0)
  62. s3 = Instance.new("Seat")
  63. s3.Parent = mod
  64. s3.Size = Vector3.new(2,1,2)
  65. s3.BrickColor = BrickColor.new(color2)
  66. s3.BottomSurface = "Smooth"
  67. s3:BreakJoints()
  68. weld = Instance.new("Weld")
  69. weld.Parent = eng
  70. weld.Part0 = eng
  71. weld.Part1 = s3
  72. weld.C0 = CFrame.new(-5,1,-5) * CFrame.Angles(0,math.pi,0)
  73. s4 = Instance.new("Seat")
  74. s4.Parent = mod
  75. s4.Size = Vector3.new(2,1,2)
  76. s4.BrickColor = BrickColor.new(color2)
  77. s4.BottomSurface = "Smooth"
  78. s4:BreakJoints()
  79. weld = Instance.new("Weld")
  80. weld.Parent = eng
  81. weld.Part0 = eng
  82. weld.Part1 = s4
  83. weld.C0 = CFrame.new(-5,1,5) * CFrame.Angles(0,math.pi,0)
  84.  
  85.  
  86. -------Gui--------by lord1sheen
  87. local starter = Instance.new("ScreenGui")
  88. starter.Parent = lord1.PlayerGui
  89.  
  90. script.Parent = starter
  91.  
  92.  
  93. local fu1 = Instance.new("Frame")
  94. fu1.Parent = starter
  95. fu1.Position = UDim2.new(0,1000,0,540)
  96.  
  97. local u1 = Instance.new("TextButton")
  98. u1.Text = "+30"
  99. u1.Size = UDim2.new(0,40,0,20)
  100. u1.Parent = fu1
  101. u1.FontSize = "Size12"
  102. u1.BorderSizePixel = 3
  103. u1.Transparency = 0.2
  104. u1.Name = "u"
  105. u1.TextColor = BrickColor.new("Really red")
  106. u1.BackgroundColor = BrickColor.new("Really black")
  107. u1.Position = UDim2.new(0,0,0,-200)
  108. function click()
  109. for i = 1, 10 do
  110. wait()
  111. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y+3, lord2[mod.Name].Head.Hover.position.Z)
  112. wait(0.1)
  113. end
  114. end
  115. u1.MouseButton1Down:connect(click)
  116.  
  117.  
  118. local fu2 = Instance.new("Frame")
  119. fu2.Parent = starter
  120. fu2.Position = UDim2.new(0,1000,0,560)
  121.  
  122. local u2 = Instance.new("TextButton")
  123. u2.Text = "+22.5"
  124. u2.Size = UDim2.new(0,40,0,20)
  125. u2.Parent = fu2
  126. u2.FontSize = "Size12"
  127. u2.BorderSizePixel = 3
  128. u2.Transparency = 0.2
  129. u2.Name = "u"
  130. u2.TextColor = BrickColor.new("Really red")
  131. u2.BackgroundColor = BrickColor.new("Really black")
  132. u2.Position = UDim2.new(0,0,0,-200)
  133. function click()
  134. for i = 1, 10 do
  135. wait()
  136. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y+2.25, lord2[mod.Name].Head.Hover.position.Z)
  137. wait(0.1)
  138. end
  139. end
  140. u2.MouseButton1Down:connect(click)
  141.  
  142.  
  143. local fu3 = Instance.new("Frame")
  144. fu3.Parent = starter
  145. fu3.Position = UDim2.new(0,1000,0,580)
  146.  
  147. local u3 = Instance.new("TextButton")
  148. u3.Text = "+15"
  149. u3.Size = UDim2.new(0,40,0,20)
  150. u3.Parent = fu3
  151. u3.FontSize = "Size12"
  152. u3.BorderSizePixel = 3
  153. u3.Transparency = 0.2
  154. u3.Name = "u"
  155. u3.TextColor = BrickColor.new("Really red")
  156. u3.BackgroundColor = BrickColor.new("Really black")
  157. u3.Position = UDim2.new(0,0,0,-200)
  158. function click()
  159. for i = 1, 10 do
  160. wait()
  161. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y+1.5, lord2[mod.Name].Head.Hover.position.Z)
  162. wait(0.1)
  163. end
  164. end
  165. u3.MouseButton1Down:connect(click)
  166.  
  167.  
  168. local fu4 = Instance.new("Frame")
  169. fu4.Parent = starter
  170. fu4.Position = UDim2.new(0,1000,0,600)
  171.  
  172. local u4 = Instance.new("TextButton")
  173. u4.Text = "+7.5"
  174. u4.Size = UDim2.new(0,40,0,20)
  175. u4.Parent = fu4
  176. u4.FontSize = "Size12"
  177. u4.BorderSizePixel = 3
  178. u4.Transparency = 0.2
  179. u4.Name = "u"
  180. u4.TextColor = BrickColor.new("Really red")
  181. u4.BackgroundColor = BrickColor.new("Really black")
  182. u4.Position = UDim2.new(0,0,0,-200)
  183. function click()
  184. for i = 1, 10 do
  185. wait()
  186. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y+0.75, lord2[mod.Name].Head.Hover.position.Z)
  187. wait(0.1)
  188. end
  189. end
  190. u4.MouseButton1Down:connect(click)
  191.  
  192.  
  193. local fd4 = Instance.new("Frame")
  194. fd4.Parent = starter
  195. fd4.Position = UDim2.new(0,1000,0,620)
  196.  
  197. local d4 = Instance.new("TextButton")
  198. d4.Text = "-7.5"
  199. d4.Size = UDim2.new(0,40,0,20)
  200. d4.Parent = fd4
  201. d4.FontSize = "Size12"
  202. d4.BorderSizePixel = 3
  203. d4.Transparency = 0.2
  204. d4.Name = "d"
  205. d4.TextColor = BrickColor.new("Really red")
  206. d4.BackgroundColor = BrickColor.new("Really black")
  207. d4.Position = UDim2.new(0,0,0,-200)
  208. function click()
  209. for i = 1, 10 do
  210. wait()
  211. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y-0.75, lord2[mod.Name].Head.Hover.position.Z)
  212. wait(0.1)
  213. end
  214. end
  215. d4.MouseButton1Down:connect(click)
  216.  
  217.  
  218. local fd3 = Instance.new("Frame")
  219. fd3.Parent = starter
  220. fd3.Position = UDim2.new(0,1000,0,640)
  221.  
  222. local d3 = Instance.new("TextButton")
  223. d3.Text = "-15"
  224. d3.Size = UDim2.new(0,40,0,20)
  225. d3.Parent = fd3
  226. d3.FontSize = "Size12"
  227. d3.BorderSizePixel = 3
  228. d3.Transparency = 0.2
  229. d3.Name = "d"
  230. d3.TextColor = BrickColor.new("Really red")
  231. d3.BackgroundColor = BrickColor.new("Really black")
  232. d3.Position = UDim2.new(0,0,0,-200)
  233. function click()
  234. for i = 1, 10 do
  235. wait()
  236. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y-1.5, lord2[mod.Name].Head.Hover.position.Z)
  237. wait(0.1)
  238. end
  239. end
  240. d3.MouseButton1Down:connect(click)
  241.  
  242.  
  243. local fd2 = Instance.new("Frame")
  244. fd2.Parent = starter
  245. fd2.Position = UDim2.new(0,1000,0,660)
  246.  
  247. local d2 = Instance.new("TextButton")
  248. d2.Text = "-22.5"
  249. d2.Size = UDim2.new(0,40,0,20)
  250. d2.Parent = fd2
  251. d2.FontSize = "Size12"
  252. d2.BorderSizePixel = 3
  253. d2.Transparency = 0.2
  254. d2.Name = "d"
  255. d2.TextColor = BrickColor.new("Really red")
  256. d2.BackgroundColor = BrickColor.new("Really black")
  257. d2.Position = UDim2.new(0,0,0,-200)
  258. function click()
  259. for i = 1, 10 do
  260. wait()
  261. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y-2.25, lord2[mod.Name].Head.Hover.position.Z)
  262. wait(0.1)
  263. end
  264. end
  265. d2.MouseButton1Down:connect(click)
  266.  
  267.  
  268. local fd1 = Instance.new("Frame")
  269. fd1.Parent = starter
  270. fd1.Position = UDim2.new(0,1000,0,680)
  271.  
  272. local d1 = Instance.new("TextButton")
  273. d1.Text = "-30"
  274. d1.Size = UDim2.new(0,40,0,20)
  275. d1.Parent = fd1
  276. d1.FontSize = "Size12"
  277. d1.BorderSizePixel = 3
  278. d1.Transparency = 0.2
  279. d1.Name = "d"
  280. d1.TextColor = BrickColor.new("Really red")
  281. d1.BackgroundColor = BrickColor.new("Really black")
  282. d1.Position = UDim2.new(0,0,0,-200)
  283. function click()
  284. for i = 1, 10 do
  285. wait()
  286. lord2[mod.Name].Head.Hover.position = Vector3.new(lord2[mod.Name].Head.Hover.position.X, lord2[mod.Name].Head.Hover.position.Y-3, lord2[mod.Name].Head.Hover.position.Z)
  287. wait(0.1)
  288. end
  289. end
  290. d1.MouseButton1Down:connect(click)
  291.  
  292.  
  293.  
  294. -------AI program--------by zethal
  295.  
  296.  
  297. ---Driving Systems---
  298. bv = Instance.new("BodyVelocity")
  299. bv.Parent = eng
  300. bv.maxForce = Vector3.new(math.huge,0,math.huge)
  301. bv.velocity = Vector3.new(0,-5,0)
  302. bav = Instance.new("BodyAngularVelocity")
  303. bav.Parent = eng
  304. bav.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  305. bav.angularvelocity = Vector3.new(0,0,0)
  306. hov = Instance.new("BodyPosition")
  307. hov.Name = "Hover"
  308. hov.Parent = eng
  309. hov.maxForce = Vector3.new(0,math.huge,0)
  310. hov.position = Vector3.new(0,9,0)
  311. bg = Instance.new("BodyGyro")
  312. bg.Parent = eng
  313. bg.maxTorque = Vector3.new(math.huge,0,math.huge)
  314. bg.P = 3e+003
  315. bg.D = 500
  316. parts = mod:GetChildren()
  317. for i = 1, #parts do
  318. if parts[i].className == "Part" or parts[i].className == "WedgePart" then
  319. parts[i].Locked = true
  320. end
  321. end
  322.  
  323.  
  324. while true do
  325. wait(0)
  326. if control.Throttle == 1 then
  327. bv.velocity = eng.CFrame.lookVector*-31
  328. end
  329. if control.Throttle == -1 then
  330. bv.velocity = eng.CFrame.lookVector*31
  331. end
  332. if control.Throttle == 0 then
  333. bv.velocity = Vector3.new(0,0,0)
  334. end
  335. if control.Steer == 1 then
  336. bav.angularvelocity = Vector3.new(0,-1.5,0)
  337. end
  338. if control.Steer == -1 then
  339. bav.angularvelocity = Vector3.new(0,1.5,0)
  340. end
  341. if control.Steer == 0 then
  342. bav.angularvelocity = Vector3.new(0,0,0)
  343. end
  344.  
  345. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement