Advertisement
Kaemi

Homerun

Feb 21st, 2018
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.55 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. Sound5 = Instance.new("Sound")
  25. Sound6 = Instance.new("Sound")
  26. LocalScript7 = Instance.new("LocalScript")
  27. RemoteEvent8 = Instance.new("RemoteEvent")
  28. Script9 = Instance.new("Script")
  29. Sound10 = Instance.new("Sound")
  30. Script11 = Instance.new("Script")
  31. Animation12 = Instance.new("Animation")
  32. Animation13 = Instance.new("Animation")
  33. Animation14 = Instance.new("Animation")
  34. Tool0.Name = "HOMERUNBITCH!"
  35. Tool0.Parent = mas
  36. Tool0.GripForward = Vector3.new(-1, -0, -0)
  37. Tool0.GripPos = Vector3.new(0, 0, -1.5)
  38. Tool0.GripRight = Vector3.new(0, 1, 0)
  39. Tool0.GripUp = Vector3.new(0, 0, 1)
  40. Part1.Name = "Handle"
  41. Part1.Parent = Tool0
  42. Part1.BrickColor = BrickColor.new("Dark stone grey")
  43. Part1.Reflectance = 0.40000000596046
  44. Part1.Rotation = Vector3.new(-90, 0, 90)
  45. Part1.FormFactor = Enum.FormFactor.Plate
  46. Part1.Size = Vector3.new(1, 0.800000012, 5.52000189)
  47. Part1.CFrame = CFrame.new(-4.39999914, 2.76000214, 8.49999809, 1.45286322e-07, -0.999999881, 2.77318378e-07, 3.85828599e-07, 2.98453244e-08, 1.00000048, -1.0000006, -4.84287597e-08, -7.44502131e-07)
  48. Part1.BottomSurface = Enum.SurfaceType.Smooth
  49. Part1.TopSurface = Enum.SurfaceType.Smooth
  50. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  51. Part1.Position = Vector3.new(-4.39999914, 2.76000214, 8.49999809)
  52. Part1.Orientation = Vector3.new(-90, 90, 0)
  53. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  54. SpecialMesh2.Parent = Part1
  55. SpecialMesh2.MeshId = "rbxassetid://54983181"
  56. SpecialMesh2.Scale = Vector3.new(3, 3, 2)
  57. SpecialMesh2.TextureId = "rbxassetid://183854972"
  58. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  59. SpecialMesh2.Scale = Vector3.new(3, 3, 2)
  60. Sound3.Name = "Hit"
  61. Sound3.Parent = Part1
  62. Sound3.SoundId = "rbxassetid://386946017"
  63. Sound4.Name = "Swing"
  64. Sound4.Parent = Part1
  65. Sound4.SoundId = "rbxassetid://101164100"
  66. Sound5.Name = "Swingy"
  67. Sound5.Parent = Part1
  68. Sound5.SoundId = "rbxassetid://1306070008"
  69. Sound6.Name = "Strike"
  70. Sound6.Parent = Part1
  71. Sound6.SoundId = "rbxassetid://491296320"
  72. Sound6.Volume = 1
  73. LocalScript7.Name = "Client"
  74. LocalScript7.Parent = Tool0
  75. table.insert(cors,sandbox(LocalScript7,function()
  76. local Player = game:GetService("Players").LocalPlayer
  77. local UIS = game:GetService("UserInputService")
  78. local Mouse = Player:GetMouse()
  79. local Tool = script.Parent
  80. local Remote = Tool:WaitForChild("Remote")
  81. local Tracks = {}
  82. local InputType = Enum.UserInputType
  83.  
  84. function playAnimation(animName, ...)
  85. if Tracks[animName] then
  86. Tracks[animName]:Play()
  87. else
  88. local anim = Tool:FindFirstChild(animName)
  89. if anim and Tool.Parent and Tool.Parent:FindFirstChild("Humanoid") then
  90. Tracks[animName] = Tool.Parent.Humanoid:LoadAnimation(anim)
  91. playAnimation(animName, ...)
  92. end
  93. end
  94. end
  95.  
  96. function stopAnimation(animName)
  97. if Tracks[animName] then
  98. Tracks[animName]:Stop()
  99. end
  100. end
  101.  
  102. function inputBegan(input)
  103. if input.UserInputType == InputType.MouseButton1 then
  104. Remote:FireServer("NormalStart")
  105. end
  106. end
  107.  
  108. function inputEnded(input)
  109. if input.UserInputType == InputType.MouseButton1 then
  110. Remote:FireServer("NormalStop")
  111. end
  112. end
  113.  
  114. function onRemote(func, ...)
  115. if func == "PlayAnimation" then
  116. playAnimation(...)
  117. elseif func == "StopAnimation" then
  118. stopAnimation(...)
  119. end
  120. end
  121.  
  122. UIS.InputBegan:connect(inputBegan)
  123. UIS.InputEnded:connect(inputEnded)
  124. Remote.OnClientEvent:connect(onRemote)
  125. end))
  126. RemoteEvent8.Name = "Remote"
  127. RemoteEvent8.Parent = Tool0
  128. Script9.Parent = Tool0
  129. table.insert(cors,sandbox(Script9,function()
  130. EquipSound = script.Parent.EquipSound
  131. Tool = script.Parent
  132. Tool.Equipped:connect(function()
  133. local Equip = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Equip)
  134. Equip:Play()
  135. EquipSound:Play()
  136. end)
  137.  
  138. Tool.Unequipped:connect(function()
  139. local Equip = script.Parent.Parent.Parent.Character.Humanoid:LoadAnimation(script.Parent.Equip)
  140. Equip:Stop()
  141. end)
  142. end))
  143. Sound10.Name = "EquipSound"
  144. Sound10.Parent = Tool0
  145. Sound10.SoundId = "rbxassetid://169799883"
  146. Script11.Name = "Server"
  147. Script11.Parent = Tool0
  148. table.insert(cors,sandbox(Script11,function()
  149. local Tool = script.Parent
  150. local Remote = Tool:WaitForChild("Remote")
  151. local Handle = Tool:WaitForChild("Handle")
  152. local Mesh = Handle:WaitForChild("Mesh")
  153.  
  154. local Equipping = false
  155. local Grip = nil
  156.  
  157.  
  158. local AttackAble = true
  159. local AttackRestTime = 0.5
  160. local AttackVictims = {}
  161. local AttackDamage = 99.99
  162. local AttackWindow = 0.66
  163. local AttackDamaging = false
  164. local AttackWindup = 0.1
  165.  
  166.  
  167. function getPlayer()
  168. local char = Tool.Parent
  169. return game:GetService("Players"):GetPlayerFromCharacter(char)
  170. end
  171.  
  172. function contains(t, v)
  173. for _, val in pairs(t) do
  174. if val == v then
  175. return true
  176. end
  177. end
  178. return false
  179. end
  180.  
  181. function tagHuman(human)
  182. local tag = Instance.new("ObjectValue")
  183. tag.Value = getPlayer()
  184. tag.Name = "creator"
  185. tag.Parent = human
  186. game:GetService("Debris"):AddItem(tag)
  187. end
  188.  
  189. function convertGrip()
  190. if Tool.Parent and Tool.Parent:FindFirstChild("Right Arm") then
  191. local weld = Tool.Parent["Right Arm"]:FindFirstChild("RightGrip")
  192. if weld then
  193. Grip = Instance.new("Motor6D")
  194. Grip.Name = "RightGrip"
  195. Grip.Part0 = weld.Part0
  196. Grip.Part1 = weld.Part1
  197. Grip.C0 = weld.C0
  198. Grip.C1 = weld.C1
  199. Grip.Parent = weld.Parent
  200. weld:Destroy()
  201. end
  202. end
  203. end
  204.  
  205. function normal()
  206. if not AttackAble then return end
  207.  
  208. --rest
  209. AttackAble = false
  210. delay(AttackRestTime, function()
  211. AttackAble = true
  212. end)
  213.  
  214. --damage
  215. delay(AttackWindup, function()
  216. AttackVictims = {}
  217. AttackDamaging = true
  218. delay(AttackWindow, function()
  219. AttackDamaging = false
  220. end)
  221. end)
  222.  
  223. --sound
  224. Handle.Swing:Play()
  225.  
  226. --animation
  227. delay(0.66, function()
  228. end)
  229. Remote:FireClient(getPlayer(), "PlayAnimation", "Swing1")
  230. end
  231.  
  232. function shove(char)
  233. local wielder = Tool.Parent
  234. if wielder and wielder:FindFirstChild("HumanoidRootPart") and char and char:FindFirstChild("HumanoidRootPart") then
  235. local shover = wielder.HumanoidRootPart
  236. local shovee = char.HumanoidRootPart
  237.  
  238. local distance = 200
  239. local duration = 1
  240. local speed = distance/duration
  241.  
  242. local velocity = (shovee.Position - shover.Position).unit * speed
  243.  
  244. Handle.Hit.Volume = 1
  245. Handle.Hit:Play()
  246. Handle.Strike.Volume = 1
  247. Handle.Strike:Play()
  248. local shoveForce = Instance.new("BodyVelocity")
  249. shoveForce.maxForce = Vector3.new(1e9, 1e9, 1e9)
  250. shoveForce.velocity = velocity
  251. shoveForce.Parent = shovee
  252. game:GetService("Debris"):AddItem(shoveForce, duration)
  253. local humanoid = char:FindFirstChild("Humanoid")
  254. humanoid.Sit = true
  255.  
  256. wait(1)
  257. humanoid.Jump = true
  258. end
  259. end
  260.  
  261. function onHandleTouched(part)
  262. if not AttackDamaging then return end
  263. if part:IsDescendantOf(Tool.Parent) then return end
  264.  
  265. if part.Parent and part.Parent:FindFirstChild("Humanoid") then
  266. local human = part.Parent.Humanoid
  267. if not contains(AttackVictims, human) then
  268. table.insert(AttackVictims, human)
  269. tagHuman(human)
  270. human:TakeDamage(AttackDamage)
  271. shove(part.Parent)
  272. end
  273. end
  274. end
  275.  
  276. function onEquip()
  277. if Equipping then return end
  278. Equipping = true
  279.  
  280. convertGrip()
  281.  
  282. --animation
  283.  
  284. Equipping = false
  285. end
  286.  
  287. function onUnequip()
  288. if Grip then
  289. Grip:Destroy()
  290. end
  291.  
  292. --animation
  293. end
  294.  
  295. function onRemote(player, func, ...)
  296. if player ~= getPlayer() then return end
  297.  
  298. if func == "NormalStart" then
  299. normal()
  300. end
  301. end
  302.  
  303. Tool.Equipped:connect(onEquip)
  304. Tool.Unequipped:connect(onUnequip)
  305. Remote.OnServerEvent:connect(onRemote)
  306. Handle.Touched:connect(onHandleTouched)
  307. end))
  308. Animation12.Name = "Equip"
  309. Animation12.Parent = Tool0
  310. Animation12.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  311. Animation13.Name = "Idle"
  312. Animation13.Parent = Tool0
  313. Animation13.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
  314. Animation14.Name = "Swing1"
  315. Animation14.Parent = Tool0
  316. Animation14.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  317. for i,v in pairs(mas:GetChildren()) do
  318. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  319. pcall(function() v:MakeJoints() end)
  320. end
  321. mas:Destroy()
  322. for i,v in pairs(cors) do
  323. spawn(function()
  324. pcall(v)
  325. end)
  326. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement