Advertisement
AndyWolf6610

Sprite

Nov 20th, 2019
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Sound3 = Instance.new("Sound")
  23. Sound4 = Instance.new("Sound")
  24. LocalScript5 = Instance.new("LocalScript")
  25. Tool0.Name = "Sprite"
  26. Tool0.Parent = mas
  27. Tool0.TextureId = "http://www.roblox.com/asset/?id=40786011"
  28. Tool0.Grip = CFrame.new(0, 0, 0.300000012, 1, 0, -0, -0, 1, -0, 0, 0, 1)
  29. Tool0.GripPos = Vector3.new(0, 0, 0.300000012)
  30. Part1.Name = "Handle"
  31. Part1.Parent = Tool0
  32. Part1.CFrame = CFrame.new(8.31000042, 0.694999993, 152.369995, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  33. Part1.Position = Vector3.new(8.31000042, 0.694999993, 152.369995)
  34. Part1.Size = Vector3.new(1, 1.20000005, 1)
  35. SpecialMesh2.Parent = Part1
  36. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=28501599"
  37. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=40785956"
  38. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  39. Sound3.Name = "Drink"
  40. Sound3.Parent = Part1
  41. Sound3.SoundId = "http://www.roblox.com/asset/?id=10722059"
  42. Sound4.Name = "Goal"
  43. Sound4.Parent = Part1
  44. Sound4.PlayOnRemove = true
  45. Sound4.SoundId = "http://www.roblox.com/asset/?id=26635106"
  46. LocalScript5.Name = "PotionScript"
  47. LocalScript5.Parent = Tool0
  48. table.insert(cors,sandbox(LocalScript5,function()
  49. local Tool = script.Parent;
  50. local dancer = nil
  51. local debris = game:GetService("Debris")
  52. local enabled = true
  53. local drinker = nil
  54. local humanoid = nil
  55.  
  56. local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
  57. local gravity = 1.05 -- things float at > 1
  58.  
  59. function onActivated()
  60. if not enabled then
  61. return
  62. end
  63.  
  64. enabled = false
  65.  
  66. humanoid = Tool.Parent:FindFirstChild("Humanoid")
  67. local bodyPos = Instance.new("BodyPosition")
  68.  
  69. drinker = humanoid:LoadAnimation(Tool.drink)
  70. drinker:Play()
  71. wait(0.35)
  72. Tool.Handle.Drink:Play()
  73. wait(1)
  74. drinker:remove()
  75.  
  76. local hats = {}
  77.  
  78. if humanoid.Parent:FindFirstChild("GoalHat") == nil then
  79.  
  80. local humanStuff = humanoid.Parent:GetChildren()
  81. for i = 1, #humanStuff do
  82.  
  83. if humanStuff[i].className == "Hat" then
  84. table.insert(hats,humanStuff[i])
  85. if humanStuff[i]:FindFirstChild("Handle") ~= nil then
  86. humanStuff[i].Handle.Transparency = 1
  87. end
  88. end
  89.  
  90. end
  91.  
  92. local hat = Instance.new("Hat")
  93. hat.AttachmentPos = Vector3.new(-0, 0.05, 0.15)
  94.  
  95. local handle = Instance.new("Part")
  96. handle.Name = "Handle"
  97. handle.Size = Vector3.new(1, 1, 2)
  98. local mesh = Instance.new("SpecialMesh")
  99.  
  100. mesh.MeshId = "http://www.roblox.com/asset/?id=24102159"
  101. mesh.TextureId = "http://www.roblox.com/asset/?id=40001333"
  102. mesh.Scale = Vector3.new(1.03, 1.1, 1.1)
  103.  
  104. mesh.Parent = handle
  105. handle.Parent = hat
  106.  
  107. hat.Parent = humanoid.Parent
  108. --[[local hat = Tool.GoalHat:clone()
  109. hat.Parent = humanoid.Parent]]
  110. debris:AddItem(hat,6.3)
  111. end
  112.  
  113. Tool.Handle.Goal:Play()
  114.  
  115. local mass = recursiveGetLift(Tool.Parent)
  116.  
  117. bodyPos.P = mass * 5
  118. bodyPos.D = 0
  119. bodyPos.maxForce = Vector3.new(bodyPos.P,bodyPos.P,bodyPos.P)
  120. bodyPos.position = Vector3.new(0,0,0)
  121.  
  122. local torso = humanoid.Parent:FindFirstChild("Torso")
  123. if torso ~= nil then
  124.  
  125. local lookAt = torso.CFrame.lookVector.unit
  126. local denom = math.abs(lookAt.x) + math.abs(lookAt.z)
  127. local xPos = lookAt.x/denom
  128. local zPos = lookAt.z/denom
  129. local moveForward = 48
  130.  
  131. bodyPos.position = Vector3.new(torso.Position.x + (xPos * moveForward), torso.Position.y, torso.Position.z + (zPos * moveForward))
  132.  
  133. end
  134.  
  135. dancer = humanoid:LoadAnimation(Tool.goal)
  136. dancer:Play(0.1,1,0.5)
  137. wait(0.5)
  138. if torso ~= nil then
  139. bodyPos.Parent = torso
  140. end
  141. debris:AddItem(bodyPos,2.25)
  142. wait(2.3)
  143. humanoid.Jump = true
  144. wait(3.5)
  145.  
  146. for i = 1, #hats do
  147. hats[i].Handle.Transparency = 0
  148. end
  149.  
  150. enabled = true
  151.  
  152. end
  153.  
  154. function onEquipped()
  155. Tool.Handle.Goal:Stop()
  156. end
  157.  
  158. function onUnequipped()
  159. print("hit it")
  160.  
  161. Tool.Handle.Goal:Stop()
  162. if dancer ~= nil then
  163. dancer:Stop()
  164. dancer:remove()
  165. end
  166.  
  167. end
  168.  
  169. function recursiveGetLift(node)
  170. local m = 0
  171. local c = node:GetChildren()
  172. if (node:FindFirstChild("Head") ~= nil) then head = node:FindFirstChild("Head") end -- nasty hack to detect when your parts get blown off
  173.  
  174. for i=1,#c do
  175. if c[i].className == "Part" then
  176. if (head ~= nil and (c[i].Position - head.Position).magnitude < 10) then -- GROSS
  177. if c[i].Name == "Handle" then
  178. m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
  179. else
  180. m = m + (c[i]:GetMass() * equalizingForce * gravity)
  181. end
  182. end
  183. end
  184. m = m + recursiveGetLift(c[i])
  185. end
  186. return m
  187. end
  188.  
  189. Tool.Activated:connect(onActivated)
  190. Tool.Equipped:connect(onEquipped)
  191. Tool.Unequipped:connect(OnUnequipped)
  192.  
  193. end))
  194. for i,v in pairs(mas:GetChildren()) do
  195. v.Parent = script
  196. pcall(function() v:MakeJoints() end)
  197. end
  198. mas:Destroy()
  199. for i,v in pairs(cors) do
  200. spawn(function()
  201. pcall(v)
  202. end)
  203. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement