Advertisement
voidman

Untitled

Dec 27th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.41 KB | None | 0 0
  1. --]]
  2. --https://github.com/Mokiros/roblox-FE-compatibility
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  5. local RealPlayer = Player
  6. 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
  7. repeat wait() until game:service'Players'.LocalPlayer.Character
  8. --[[
  9.  
  10. - Added new color scheme.
  11. - Some minor edits.
  12. - New engine type, for your faster speed requirements.
  13. - Camera bug fix.
  14. ]]--
  15. do --CFrame lerp
  16. local function QuaternionFromCFrame(cf)
  17. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  18. local trace = m00 + m11 + m22
  19. if trace > 0 then
  20. local s = math.sqrt(1 + trace)
  21. local recip = 0.5/s
  22. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  23. else
  24. local i = 0
  25. if m11 > m00 then
  26. i = 1
  27. end
  28. if m22 > (i == 0 and m00 or m11) then
  29. i = 2
  30. end
  31. if i == 0 then
  32. local s = math.sqrt(m00-m11-m22+1)
  33. local recip = 0.5/s
  34. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  35. elseif i == 1 then
  36. local s = math.sqrt(m11-m22-m00+1)
  37. local recip = 0.5/s
  38. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  39. elseif i == 2 then
  40. local s = math.sqrt(m22-m00-m11+1)
  41. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  42. end
  43. end
  44. end
  45. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  46. local xs, ys, zs = x + x, y + y, z + z
  47. local wx, wy, wz = w*xs, w*ys, w*zs
  48. local xx = x*xs
  49. local xy = x*ys
  50. local xz = x*zs
  51. local yy = y*ys
  52. local yz = y*zs
  53. local zz = z*zs
  54. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  55. end
  56. local function QuaternionSlerp(a, b, t)
  57. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  58. local startInterp, finishInterp;
  59. if cosTheta >= 0.0001 then
  60. if (1 - cosTheta) > 0.0001 then
  61. local theta = math.acos(cosTheta)
  62. local invSinTheta = 1/math.sin(theta)
  63. startInterp = math.sin((1-t)*theta)*invSinTheta
  64. finishInterp = math.sin(t*theta)*invSinTheta
  65. else
  66. startInterp = 1-t
  67. finishInterp = t
  68. end
  69. else
  70. if (1+cosTheta) > 0.0001 then
  71. local theta = math.acos(-cosTheta)
  72. local invSinTheta = 1/math.sin(theta)
  73. startInterp = math.sin((t-1)*theta)*invSinTheta
  74. finishInterp = math.sin(t*theta)*invSinTheta
  75. else
  76. startInterp = t-1
  77. finishInterp = t
  78. end
  79. end
  80. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  81. end
  82. function clerp(a,b,t)
  83. local qa = {QuaternionFromCFrame(a)}
  84. local qb = {QuaternionFromCFrame(b)}
  85. local ax, ay, az = a.x, a.y, a.z
  86. local bx, by, bz = b.x, b.y, b.z
  87. local _t = 1-t
  88. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  89. end
  90.  
  91. end
  92.  
  93. plr = game:service'Players'.LocalPlayer
  94. char = plr.Character
  95. mouse = plr:GetMouse()
  96. humanoid = char:findFirstChild("Humanoid")
  97. torso = char:findFirstChild("Torso")
  98. head = char.Head
  99. ra = char:findFirstChild("Right Arm")
  100. la = char:findFirstChild("Left Arm")
  101. rl = char:findFirstChild("Right Leg")
  102. ll = char:findFirstChild("Left Leg")
  103. rs = torso:findFirstChild("Right Shoulder")
  104. ls = torso:findFirstChild("Left Shoulder")
  105. rh = torso:findFirstChild("Right Hip")
  106. lh = torso:findFirstChild("Left Hip")
  107. neck = torso:findFirstChild("Neck")
  108. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  109. anim = char:findFirstChild("Animate")
  110. rootpart = char:findFirstChild("HumanoidRootPart")
  111. camera = workspace.CurrentCamera
  112. modelforparts = char:findFirstChild("ModelForParts") or Instance.new("Model", char)
  113. modelforparts.Name = "ModelForParts"
  114. equipped = false
  115. local MAXSPEED = 90
  116. local SPEED = 0
  117. bg = Instance.new("BodyGyro")
  118. bg.maxTorque = Vector3.new(9e6,9e6,9e6)
  119. bg.D = 800
  120. bv = Instance.new("BodyVelocity")
  121. bv.maxForce = Vector3.new(9e6,9e6,9e6)
  122.  
  123. local sound = Instance.new("Sound", head)
  124. sound.Volume = 1
  125. sound.Pitch = 2
  126. sound.SoundId = "http://www.roblox.com/asset/?id=142782429"
  127. sound.Looped = true
  128. wait()
  129. sound:play()
  130.  
  131.  
  132. ColorScheme1 = BrickColor.new(106)
  133. ColorScheme2 = BrickColor.new(40)
  134. ColorScheme3 = BrickColor.new(199)
  135. ANGLE = 0
  136. equipped = true
  137.  
  138. rs.Parent = nil
  139. ls.Parent = nil
  140. rh.Parent = nil
  141. lh.Parent = nil
  142. anim.Parent = nil
  143. wait()
  144. local rm = Instance.new("Weld", modelforparts)
  145. rm.C0 = CFrame.new(1.5, 0.5, 0)
  146. rm.C1 = CFrame.new(0, 0.5, 0)
  147. rm.Part0 = torso
  148. rm.Part1 = ra
  149. local lm = Instance.new("Weld", modelforparts)
  150. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  151. lm.C1 = CFrame.new(0, 0.5, 0)
  152. lm.Part0 = torso
  153. lm.Part1 = la
  154. local rlegm = Instance.new("Weld", modelforparts)
  155. rlegm.C0 = CFrame.new(0.5, -1, 0)
  156. rlegm.C1 = CFrame.new(0, 1, 0)
  157. rlegm.Part0 = torso
  158. rlegm.Part1 = rl
  159. local llegm = Instance.new("Weld", modelforparts)
  160. llegm.C0 = CFrame.new(-0.5, -1, 0)
  161. llegm.C1 = CFrame.new(0, 1, 0)
  162. llegm.Part0 = torso
  163. llegm.Part1 = ll
  164.  
  165. --grey part
  166. local part = Instance.new("Part", modelforparts)
  167. part.Size = Vector3.new(2.2, .85, 2.2)
  168. part.FormFactor = 'Custom'
  169. part.BrickColor = ColorScheme3
  170. part.Locked = true
  171. part.TopSurface = 10
  172. part.BottomSurface = 10
  173. part.LeftSurface = 10
  174. part.RightSurface = 10
  175. part.FrontSurface = 10
  176. part.BackSurface = 10
  177. part:breakJoints()
  178. part.Material = "SmoothPlastic"
  179. part.CanCollide = false
  180. Instance.new("CylinderMesh", part)
  181. local weld = Instance.new("Weld", part)
  182. weld.Part0 = part
  183. weld.Part1 = torso
  184. weld.C1 = CFrame.new(0, -2.1, 0)
  185. weld.C0 = CFrame.Angles(math.pi/2, math.pi/2, 0) * CFrame.new(0, 0, .95)
  186. --orange part
  187. local part2 = part:clone()
  188. part2.Parent = modelforparts
  189. part2.Size = Vector3.new(2.5, 1.05, 2.5)
  190. part2.BrickColor = ColorScheme1
  191. local wld2 = Instance.new("Weld", part)
  192. wld2.Part0 = part2
  193. wld2.Part1 = part
  194. wld2.C1 = CFrame.new()
  195. wld2.C0 = CFrame.new()
  196. --white part
  197. local part3 = part:clone()
  198. part3.Parent = modelforparts
  199. part3.Size = Vector3.new(2.62, .5, 2.62)
  200. part3.BrickColor = ColorScheme2
  201. local wld3 = Instance.new("Weld", part)
  202. wld3.Part0 = part3
  203. wld3.Part1 = part
  204. wld3.C1 = CFrame.new()
  205. wld3.C0 = CFrame.new()
  206. --airblower
  207. local airblowercyl = part:clone()
  208. airblowercyl.Parent = modelforparts
  209. airblowercyl.Size = Vector3.new(.95, 3.5, .95)
  210. airblowercyl.BrickColor = ColorScheme3
  211. local smoke = Instance.new("Smoke", airblowercyl)
  212. smoke.Color = Color3.new(.3, .3, .3)
  213. smoke.RiseVelocity = 10
  214. smoke.Opacity = .1
  215. local cwld = Instance.new("Weld", airblowercyl)
  216. cwld.Part0 = airblowercyl
  217. cwld.Part1 = part
  218. cwld.C1 = CFrame.Angles(0, 0, -math.pi/2)
  219. cwld.C0 = CFrame.new(0, -1.85-0.925, -.6) * CFrame.Angles(math.pi/14, 0, 0)
  220.  
  221. --handles
  222. local hndl = part:clone()
  223. hndl.Parent = modelforparts
  224. hndl.Size = Vector3.new(.2, .4, .2)
  225. hndl.BrickColor = BrickColor.new(26)
  226. hndl.Mesh:Destroy()
  227. local hwld = Instance.new("Weld", hndl)
  228. hwld.Part1 = part
  229. hwld.Part0 = hndl
  230. hwld.C1 = CFrame.new(.1, 0, 0) * CFrame.Angles(math.pi/2, 0, 0)
  231. hwld.C0 = CFrame.new(0, -.82 - .4, 0)
  232. Instance.new("BlockMesh", hndl).Scale = Vector3.new(.5, 1, .5)
  233. local hndl2 = hndl:clone()
  234. hndl2.Parent = modelforparts
  235. hndl2.Size = Vector3.new(.8, .2, .2)
  236. local hwld2 = Instance.new("Weld", hndl2)
  237. hwld2.Part0 = hndl2
  238. hwld2.Part1 = part
  239. hwld2.C1 = CFrame.new(-.25, 0, 0) * CFrame.Angles(math.pi/2, 0, 0)
  240. hwld2.C0 = CFrame.new(0, -1 - .4, 0)
  241. hndl2.Mesh.Scale = Vector3.new(1, .5, .5)
  242. local hndl3 = hndl:clone()
  243. hndl3.Parent = modelforparts
  244. hndl3.Size = Vector3.new(.2, .4, .2)
  245. local hwld3 = Instance.new("Weld", hndl3)
  246. hwld3.Part0 = hndl3
  247. hwld3.Part1 = part
  248. hwld3.C1 = CFrame.new(-.6, 0, 0) * CFrame.Angles(math.pi/2, 0, 0)
  249. hwld3.C0 = CFrame.new(0, -.82 - .4, 0)
  250. --balloon ropes
  251. local blnrope = part:clone()
  252. blnrope.Parent = modelforparts
  253. blnrope.Size = Vector3.new(.2, 3.8, .2)
  254. blnrope.BrickColor = BrickColor.new(1)
  255. blnrope.Mesh:Destroy()
  256. local blnwld = Instance.new("Weld", blnrope)
  257. blnwld.Part0 = blnrope
  258. blnwld.Part1 = airblowercyl
  259. blnwld.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2, math.pi/7, -math.pi/8)
  260. blnwld.C0 = CFrame.new(0, -2, 0)
  261. Instance.new("BlockMesh", blnrope).Scale = Vector3.new(.2, 1, .2)
  262. local blnrope2 = blnrope:clone()
  263. blnrope2.Parent = modelforparts
  264. blnrope2.Size = Vector3.new(.2, 4, .2)
  265. local blnwld2 = Instance.new("Weld", blnrope2)
  266. blnwld2.Part0 = blnrope2
  267. blnwld2.Part1 = airblowercyl
  268. blnwld2.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2, math.pi/4, -math.pi/74)
  269. blnwld2.C0 = CFrame.new(0, -2.2, 0)
  270. local blnrope3 = blnrope:clone()
  271. blnrope3.Parent = modelforparts
  272. local blnwld3 = Instance.new("Weld", blnrope3)
  273. blnwld3.Part0 = blnrope3
  274. blnwld3.Part1 = airblowercyl
  275. blnwld3.C0 = CFrame.new(0, -2, 0)
  276.  
  277.  
  278. --Stored balloon rope welds
  279. blnwldC1 = blnwld.C1
  280. blnwld2C1 = blnwld2.C1
  281. blnwld3C1 = blnwld3.C1
  282. --balloons
  283. local bln = part:clone()
  284. bln.Parent = modelforparts
  285. bln.Size = Vector3.new(1.65, 1.8, 1.65)
  286. bln.BrickColor = BrickColor.new(119)
  287. bln.Mesh:Destroy()
  288. bln.Transparency = .1
  289. local balnwld = Instance.new("Weld", bln)
  290. balnwld.Part0 = bln
  291. balnwld.Part1 = blnrope
  292. balnwld.C1 = CFrame.new(0, 0, 0)
  293. balnwld.C0 = CFrame.new(0, -2.6, 0)
  294. Instance.new("SpecialMesh", bln).MeshType = "Sphere"
  295. local bln2 = bln:clone()
  296. bln2.Parent = modelforparts
  297. bln2.BrickColor = BrickColor.new(23)
  298. local balnwld2 = Instance.new("Weld", bln2)
  299. balnwld2.Part0 = bln2
  300. balnwld2.Part1 = blnrope2
  301. balnwld2.C1 = CFrame.new(0, 0, 0)
  302. balnwld2.C0 = CFrame.new(0, -2.8, 0)
  303. local bln3 = bln:clone()
  304. bln3.Parent = modelforparts
  305. bln3.BrickColor = BrickColor.new(21)
  306. local balnwld3 = Instance.new("Weld", bln3)
  307. balnwld3.Part0 = bln3
  308. balnwld3.Part1 = blnrope3
  309. balnwld3.C0 = CFrame.new(0, -2.6, 0)
  310.  
  311. --Controls
  312. bg.Parent = rootpart
  313. bv.Parent = rootpart
  314. forwards = false
  315. backwards = false
  316. mouse.KeyDown:connect(function(k)
  317. if k == "w" then
  318. forwards = true
  319. coroutine.wrap(function()
  320. while forwards do wait()
  321. if SPEED >= MAXSPEED then SPEED = MAXSPEED forwards = false break end
  322. sound.Volume = sound.Volume + .05
  323. if sound.Volume >= .5 then sound.Volume = .5 end
  324. SPEED = SPEED + 5
  325. end
  326. end)()
  327. end
  328. end)
  329. mouse.KeyUp:connect(function(k)
  330. if k == "w" then
  331. forwards = false
  332. coroutine.wrap(function()
  333. while SPEED >= 0 do wait()
  334. sound.Volume = sound.Volume - .05
  335. if sound.Volume <= 0.25 then sound.Volume = 0.25 end
  336. SPEED = SPEED - 5
  337. if forward then break end
  338. if SPEED <= 0 then SPEED = 0 break end
  339. end
  340. end)()
  341. end
  342. end)
  343. --BALLONS MOOOOVEEE :DDD
  344. game:service'RunService'.RenderStepped:connect(function()
  345. if not equipped then return end
  346. blnwldC1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2 - math.rad(SPEED/1.7) + math.sin(ANGLE)*.025, math.pi/7 + math.sin(ANGLE)*.105, -math.pi/8 - math.sin(ANGLE)*.018)
  347. blnwld2C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2 - math.rad(SPEED/1.7) + math.sin(ANGLE)*.015, math.pi/4 - math.sin(ANGLE)*.065, -math.pi/74 + math.sin(ANGLE)*.021)
  348. blnwld3C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2 - math.rad(SPEED/1.7) - math.sin(ANGLE)*.02, math.pi/16 - math.sin(ANGLE)*.125, math.pi/9 - math.sin(ANGLE)*.078)
  349. blnwld.C1 = clerp(blnwld.C1, blnwldC1, 0.05)
  350. blnwld2.C1 = clerp(blnwld2.C1, blnwld2C1, 0.05)
  351. blnwld3.C1 = clerp(blnwld3.C1, blnwld3C1, 0.05)
  352. end)
  353.  
  354. --positioning welds
  355. lm.C0 = CFrame.new(-1.25, .05, -.5) * CFrame.Angles(math.rad(35), 0, math.rad(45))
  356. rm.C0 = CFrame.new(1.25, .05, -.5) * CFrame.Angles(math.rad(35), 0, -math.rad(45))
  357. llegm.C0 = CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0, -math.rad(15))
  358. rlegm.C0 = CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0, math.rad(15))
  359.  
  360.  
  361.  
  362. game:service'RunService'.RenderStepped:connect(function()
  363. for i,v in pairs(torso:children()) do if v and v:IsA'BodyGyro' then v:Destroy() end end
  364. ANGLE = (ANGLE % 360) + math.random(1, 10)/100
  365. humanoid.PlatformStand = true
  366. local rotpos = Vector3.new(camera.CoordinateFrame.x, camera.CoordinateFrame.y, camera.CoordinateFrame.z)
  367. bg.cframe = CFrame.new(torso.Position,rotpos) * CFrame.Angles(0, math.pi, 0)
  368. bv.velocity = (torso.CFrame * CFrame.Angles(math.pi/14, 0, 0)).lookVector * SPEED
  369. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement