Advertisement
FaZeJevs

Untitled

May 29th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  1. Create = function(itemClass,tabl)
  2. local item = Instance.new(itemClass)
  3. for i,v in pairs(tabl) do
  4. local a,b = ypcall(function() return item[i] end)
  5. if a then
  6. item[i] = tabl[i]
  7. end
  8. end
  9. return item
  10. end
  11. function runDummyScript(f,scri)
  12. local oldenv = getfenv(f)
  13. local newenv = setmetatable({}, {
  14. __index = function(_, k)
  15. if k:lower() == 'script' then
  16. return scri
  17. else
  18. return oldenv[k]
  19. end
  20. end
  21. })
  22. setfenv(f, newenv)
  23. ypcall(function() f() end)
  24. end
  25. cors = {}
  26. mas = Instance.new("Model",game:GetService("Lighting"))
  27. mas.Name = "CompiledModel"
  28. o1 = Create("Tool",{
  29. ["Name"] = "LeopardBalloon",
  30. ["Parent"] = game.Players.LocalPlayer.Backpack,
  31. ["TextureId"] = "http://www.roblox.com/asset?id=174382920",
  32. })
  33. o2 = Create("Part",{
  34. ["Name"] = "Handle",
  35. ["Parent"] = o1,
  36. ["Position"] = Vector3.new(51.5326347, 7.96369696, 37.0017471),
  37. ["Rotation"] = Vector3.new(0.520872831, -13.3241835, -8.79623795),
  38. ["CFrame"] = CFrame.new(51.5326347, 7.96369696, 37.0017471, 0.961636603, 0.14880456, -0.23046048, -0.154985026, 0.987876952, -0.00884611066, 0.226350322, 0.0442246236, 0.973041415),
  39. ["Locked"] = true,
  40. ["FormFactor"] = Enum.FormFactor.Custom,
  41. ["Size"] = Vector3.new(1.5, 6.75, 1.5),
  42. ["BottomSurface"] = Enum.SurfaceType.Smooth,
  43. ["TopSurface"] = Enum.SurfaceType.Smooth,
  44. })
  45. o3 = Create("SpecialMesh",{
  46. ["Parent"] = o2,
  47. ["MeshId"] = "http://www.roblox.com/asset?id=174382881",
  48. ["Scale"] = Vector3.new(3.5, 3.5, 3.5),
  49. ["TextureId"] = "http://www.roblox.com/asset?id=174382946",
  50. ["MeshType"] = Enum.MeshType.FileMesh,
  51. })
  52. o5 = Create("Script",{
  53. ["Name"] = "BalloonScript",
  54. ["Parent"] = o1,
  55. })
  56. table.insert(cors,coroutine.create(function()
  57. wait()
  58. runDummyScript(function()
  59. --Made by Luckymaxer
  60.  
  61. Tool = script.Parent
  62. Handle = Tool:WaitForChild("Handle")
  63.  
  64. Players = game:GetService("Players")
  65. Debris = game:GetService("Debris")
  66.  
  67. Gravity = 196.2
  68.  
  69. Floating = false
  70.  
  71. ConnectedParts = {}
  72. Connections = {}
  73.  
  74. Animations = { --Animations by Stickmasterluke
  75. Hold = {Animation = Tool:WaitForChild("Hold"), Speed = 1},
  76. Float1 = {Animation = Tool:WaitForChild("Float1"), Speed = 1},
  77. Float2 = {Animation = Tool:WaitForChild("Float2"), Speed = 0.85}
  78. }
  79.  
  80. ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
  81. ClientControl.Name = "ClientControl"
  82. ClientControl.Parent = Tool
  83.  
  84. Grips = {
  85. Equipped = CFrame.new(-0.4, -0.5, -0.25, 1, 0, 0, 0, 0, -1, 0, 1, 0),
  86. Unequipped = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  87. }
  88.  
  89. Tool.Enabled = true
  90. Tool.Grip = Grips.Unequipped
  91.  
  92. for i, v in pairs(Handle:GetChildren()) do
  93. if v:IsA("BodyForce") then
  94. v:Destroy()
  95. end
  96. end
  97.  
  98. function InvokeClient(Mode, Value)
  99. pcall(function()
  100. ClientControl:InvokeClient(Player, Mode, Value)
  101. end)
  102. end
  103.  
  104. function CheckTable(Table, Instance)
  105. for i, v in pairs(Table) do
  106. if v == Instance then
  107. return true
  108. end
  109. end
  110. return false
  111. end
  112.  
  113. function GetAllPartsConnected(BasePart)
  114. local PartsConnected = {}
  115. local function GetPartsConnected(BasePart)
  116. local ConnectedParts = BasePart:GetConnectedParts()
  117. if #ConnectedParts > 0 then
  118. if not CheckTable(PartsConnected, BasePart) then
  119. table.insert(PartsConnected, BasePart)
  120. for i, v in pairs(ConnectedParts) do
  121. GetPartsConnected(v)
  122. end
  123. end
  124. end
  125. end
  126. GetPartsConnected(BasePart)
  127. return PartsConnected
  128. end
  129.  
  130. function ManageConnectedParts()
  131. for i, v in pairs(Connections) do
  132. if v then
  133. v:disconnect()
  134. end
  135. end
  136. Connections = {}
  137. ConnectedParts = GetAllPartsConnected(Character.PrimaryPart)
  138. for i, v in pairs(ConnectedParts) do
  139. local ChildAdded = v.ChildAdded:connect(function(Child)
  140. if Child == Handle then
  141. return
  142. end
  143. ManageConnectedParts()
  144. end)
  145. local ChildRemoved = v.ChildRemoved:connect(function()
  146. if Child == Handle then
  147. return
  148. end
  149. ManageConnectedParts()
  150. end)
  151. table.insert(Connections, ChildAdded)
  152. table.insert(Connections, ChildRemoved)
  153. end
  154. ManageForce(ConnectedParts)
  155. end
  156.  
  157. function ManageForce(Parts)
  158. if BodyForce and BodyForce.Parent then
  159. BodyForce.force = Vector3.new(0, (GetTotalMass(Parts) * 1.05), 0)
  160. end
  161. end
  162.  
  163. function GetTotalMass(Parent)
  164. local Mass = 0
  165. local function GetMass(Parent)
  166. for i, v in pairs(((type(Parent) == "table" and Parent) or Parent:GetChildren())) do
  167. if v:IsA("BasePart") then
  168. Mass = (Mass + (v:GetMass() * Gravity))
  169. end
  170. GetMass(v)
  171. end
  172. end
  173. GetMass(Parent)
  174. return Mass
  175. end
  176.  
  177. function FreeFall(Falling)
  178. if not Equipped then
  179. return
  180. end
  181. if Falling then
  182. InvokeClient("PlayAnimation", Animations.Float2)
  183. else
  184. InvokeClient("PlayAnimation", Animations.Hold)
  185. end
  186. end
  187.  
  188. function Equipped()
  189. Equipped = true
  190. Character = Tool.Parent
  191. Player = Players:GetPlayerFromCharacter(Character)
  192. Humanoid = Character:FindFirstChild("Humanoid")
  193. if not Player or not Humanoid or Humanoid.Health == 0 then
  194. return
  195. end
  196. Tool.Grip = Grips.Equipped
  197. InvokeClient("PlayAnimation", Animations.Hold)
  198. BodyForce = Instance.new("BodyForce")
  199. BodyForce.force = Vector3.new(0, 0, 0)
  200. BodyForce.Parent = Handle
  201. ManageConnectedParts()
  202. local HumanoidState = Humanoid:GetState()
  203. if HumanoidState == Enum.HumanoidStateType.Freefall then
  204. FreeFall(true)
  205. end
  206. if Equipped then
  207. HumanoidFalling = Humanoid.FreeFalling:connect(function(Falling)
  208. FreeFall(Falling)
  209. end)
  210. end
  211. end
  212.  
  213. function Unequipped()
  214. Equipped = false
  215. Tool.Grip = Grips.Unequipped
  216. --InvokeClient(nil, "StopAnimation", nil)
  217. if BodyForce and BodyForce.Parent then
  218. BodyForce:Destroy()
  219. end
  220. if HumanoidFalling then
  221. HumanoidFalling:disconnect()
  222. end
  223. end
  224.  
  225. Tool.Unequipped:connect(Unequipped)
  226. Tool.Equipped:connect(Equipped)
  227. end,o5)
  228. end))
  229. o6 = Create("Animation",{
  230. ["Name"] = "Hold",
  231. ["Parent"] = o1,
  232. ["AnimationId"] = "http://www.roblox.com/asset?id=148831127",
  233. })
  234. o7 = Create("Animation",{
  235. ["Name"] = "Float1",
  236. ["Parent"] = o1,
  237. ["AnimationId"] = "http://www.roblox.com/asset?id=148831003",
  238. })
  239. o8 = Create("Animation",{
  240. ["Name"] = "Float2",
  241. ["Parent"] = o1,
  242. ["AnimationId"] = "http://www.roblox.com/asset?id=148840371",
  243. })
  244. mas.Parent = workspace
  245. mas:MakeJoints()
  246. local mas1 = mas:GetChildren()
  247. for i=1,#mas1 do
  248. mas1[i].Parent = workspace
  249. ypcall(function() mas1[i]:MakeJoints() end)
  250. end
  251. mas:Destroy()
  252. for i=1,#cors do
  253. coroutine.resume(cors[i])
  254. end
  255. --Made by Luckymaxer
  256.  
  257. Tool = script.Parent
  258. Handle = Tool:WaitForChild("Handle")
  259.  
  260. Players = game:GetService("Players")
  261.  
  262. ClientControl = Tool:WaitForChild("ClientControl")
  263.  
  264. Equipped = false
  265.  
  266. ClientControl.OnClientInvoke = (function(Mode, Value)
  267. if not Equipped or not Humanoid then
  268. return
  269. end
  270. if Mode == "PlayAnimation" then
  271. if CurrentAnimation then
  272. CurrentAnimation:Stop()
  273. end
  274. CurrentAnimation = Humanoid:LoadAnimation(Value.Animation)
  275. if CurrentAnimation then
  276. CurrentAnimation:Play(nil, nil, Value.Speed)
  277. end
  278. elseif Mode == "StopAnimation" then
  279. if CurrentAnimation then
  280. CurrentAnimation:Stop()
  281. end
  282. end
  283. end)
  284.  
  285. function Equipped()
  286. Equipped = true
  287. Character = Tool.Parent
  288. Player = Players:GetPlayerFromCharacter(Character)
  289. Humanoid = Character:FindFirstChild("Humanoid")
  290. if not Player or not Humanoid or Humanoid.Health == 0 then
  291. return
  292. end
  293. end
  294.  
  295. function Unequipped()
  296. Equipped = false
  297. if CurrentAnimation then
  298. CurrentAnimation:Stop()
  299. end
  300. end
  301.  
  302. Tool.Unequipped:connect(Unequipped)
  303. Tool.Equipped:connect(Equipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement