Advertisement
End_Wolf

Untitled

Jul 5th, 2018
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. LocalScript3 = Instance.new("LocalScript")
  23. LocalScript4 = Instance.new("LocalScript")
  24. Animation5 = Instance.new("Animation")
  25. Camera6 = Instance.new("Camera")
  26. Sound7 = Instance.new("Sound")
  27. Tool0.Name = "Mackerel"
  28. Tool0.Parent = mas
  29. Tool0.TextureId = "http://www.roblox.com/asset/?id= 46156602 "
  30. Tool0.Grip = CFrame.new(0, -2, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  31. Tool0.GripForward = Vector3.new(-1, 0, -0)
  32. Tool0.GripPos = Vector3.new(0, -2, 0)
  33. Tool0.GripRight = Vector3.new(0, 0, -1)
  34. Part1.Name = "Handle"
  35. Part1.Parent = Tool0
  36. Part1.CFrame = CFrame.new(-2.09999847, 0.245092556, 4.36993933, -6.44848842e-06, -0.99999994, -5.96046448e-08, -1, 6.52701419e-06, -0.000248211581, 0.000248180353, 2.98023224e-08, -0.99999994)
  37. Part1.Orientation = Vector3.new(0.00999999978, -180, -90)
  38. Part1.Position = Vector3.new(-2.09999847, 0.245092556, 4.36993933)
  39. Part1.Rotation = Vector3.new(179.98999, 0, 90)
  40. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  41. Part1.Transparency = 1
  42. Part1.Size = Vector3.new(0.490000129, 0.200000003, 0.740000129)
  43. Part1.BottomSurface = Enum.SurfaceType.Smooth
  44. Part1.BrickColor = BrickColor.new("Dark stone grey")
  45. Part1.Reflectance = 0.40000000596046
  46. Part1.TopSurface = Enum.SurfaceType.Smooth
  47. Part1.brickColor = BrickColor.new("Dark stone grey")
  48. Part1.FormFactor = Enum.FormFactor.Custom
  49. Part1.formFactor = Enum.FormFactor.Custom
  50. SpecialMesh2.Parent = Part1
  51. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=46140354"
  52. SpecialMesh2.Scale = Vector3.new(0.800000012, 0.699999988, 0.699999988)
  53. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=46140461"
  54. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  55. LocalScript3.Name = "Mackerel"
  56. LocalScript3.Parent = Tool0
  57. table.insert(cors,sandbox(LocalScript3,function()
  58. -- Mackerel --
  59. -- Whack Animation, time 0.5 seconds
  60. -- Whack Sound, 0.4 seconds
  61.  
  62. -- Handle to the game service, in case we need to get the time
  63. r = game:service("RunService")
  64.  
  65. -- normal damage, when the Mackerel touches a humanoid object
  66. local damage = 5
  67.  
  68. -- Whack damage
  69. local whack_damage = 8
  70.  
  71. -- Handle to tool
  72. Mackerel = script.Parent.Handle
  73. Tool = script.Parent
  74.  
  75. -- For the Animations
  76. local WhackAnim
  77.  
  78.  
  79. -- Sounds!
  80. local MackerelWhack = Tool:FindFirstChild("FishWhack")
  81. if MackerelWhack == nil then
  82. MackerelWhack = Instance.new("Sound")
  83. MackerelWhack.Name = "FishWhack"
  84. MackerelWhack.SoundId = "http://www.roblox.com/asset/?id=46153268"
  85. MackerelWhack.Parent = Tool
  86. MackerelWhack.Volume = 1
  87. end
  88.  
  89. -- When a collision is detected between the player and another character
  90. function blow(hit)
  91. if hit == nil or hit.Parent == nil then return end
  92. local opponent = hit.Parent:findFirstChild("Torso")
  93. local humanoid = hit.Parent:findFirstChild("Humanoid")
  94. local vCharacter = Tool.Parent
  95. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  96. local myTorso = vCharacter:findFirstChild("Torso")
  97. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  98. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  99. -- final check, make sure Mackerel is in-hand
  100. local right_arm = vCharacter:FindFirstChild("Right Arm")
  101. if (right_arm ~= nil) then
  102. local joint = right_arm:FindFirstChild("RightGrip")
  103. if (joint ~= nil and (joint.Part0 == Mackerel or joint.Part1 == Mackerel)) then
  104. tagHumanoid(humanoid, vPlayer)
  105. humanoid:TakeDamage(damage)
  106. -- Add body velocity to the opponent to push him when he gets whacked
  107. local bodyVelocity = Instance.new("BodyVelocity")
  108. bodyVelocity.P = 100000
  109. bodyVelocity.maxForce = Vector3.new(bodyVelocity.P, bodyVelocity.P, bodyVelocity.P)
  110. bodyVelocity.velocity = (opponent.Position - myTorso.Position) * 6
  111. bodyVelocity.Parent = opponent
  112. wait(0.5)
  113. if bodyVelocity ~= nil then bodyVelocity:remove() end
  114. wait(0.5)
  115. untagHumanoid(humanoid)
  116. end
  117. end
  118.  
  119. end
  120. end
  121.  
  122. -- Tagging and Untagging primarily for the leaderboards
  123. function tagHumanoid(humanoid, player)
  124. local creator_tag = Instance.new("ObjectValue")
  125. creator_tag.Value = player
  126. creator_tag.Name = "creator"
  127. creator_tag.Parent = humanoid
  128. end
  129.  
  130. function untagHumanoid(humanoid)
  131. if humanoid ~= nil then
  132. local tag = humanoid:findFirstChild("creator")
  133. if tag ~= nil then
  134. tag.Parent = nil
  135. end
  136. end
  137. end
  138.  
  139.  
  140. -- On, left click!
  141. function attack()
  142. damage = whack_damage
  143. -- Play the sound
  144. if MackerelWhack then MackerelWhack:Play() end
  145. end
  146.  
  147. -- Tentative lock
  148. Tool.Enabled = true
  149.  
  150. function onActivated()
  151. if not Tool.Enabled then
  152. return
  153. end
  154. Tool.Enabled = false
  155. -- Check if the handle to the Player is still available in the space
  156. local MyPlayer = Tool.Parent
  157. if MyPlayer == nil then
  158. return
  159. end
  160. -- Check to see if the humanoid is still in the world
  161. local MyHumanoid= MyPlayer:FindFirstChild("Humanoid")
  162. if MyHumanoid == nil then
  163. return
  164. end
  165. attack()
  166. -- Load and play the animation
  167. WhackAnim = MyHumanoid:LoadAnimation(Tool.Whack)
  168. if WhackAnim then WhackAnim:Play() end
  169. -- To rotate the fish as the character swings
  170. Tool.GripForward = Vector3.new(-0.7071, 0.7071, 0.0)
  171. Tool.GripRight = Vector3.new(0.5774, 0.5774, -0.5774)
  172. Tool.GripUp = Vector3.new(0.4082, 0.4082, 0.8165)
  173. wait(0.5)
  174. -- Reset the fish to its original orientation
  175. Tool.GripForward = Vector3.new(-1.0, 0.0, 0.0)
  176. Tool.GripRight = Vector3.new(0.0, 0.0, -1.0)
  177. Tool.GripUp = Vector3.new(0.0, 1.0, 0.0)
  178. Tool.Enabled = true
  179. -- Reset the damage
  180. damage = 5
  181. end
  182.  
  183.  
  184. function onEquipped()
  185. -- Remove the sound if its still playing
  186. MackerelWhack.Volume = 1
  187. if MackerelWhack then MackerelWhack:Stop() end
  188. end
  189.  
  190. function onUnequipped()
  191. -- Remove the sounds and the animations
  192. MackerelWhack.Volume = 0
  193. if WhackAnim then WhackAnim:Stop() end
  194. if MackerelWhack then MackerelWhack:Stop() end
  195. end
  196.  
  197. Tool.Activated:connect(onActivated)
  198. Tool.Equipped:connect(onEquipped)
  199. Tool.Unequipped:connect(onUnequipped)
  200.  
  201. connection = Mackerel.Touched:connect(blow)
  202.  
  203.  
  204.  
  205. end))
  206. LocalScript4.Name = "Local Gui"
  207. LocalScript4.Parent = Tool0
  208. table.insert(cors,sandbox(LocalScript4,function()
  209. local Tool = script.Parent;
  210.  
  211. local stillEquipped = true
  212. function onEquippedLocal(mouse)
  213. stillEquipped = true
  214. if mouse == nil then
  215. print("Mouse not found")
  216. return
  217. end
  218.  
  219. while stillEquipped do
  220. print("Setting Mouse to Go")
  221. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  222.  
  223. while Tool.Enabled and stillEquipped do
  224. wait(.01)
  225. end
  226.  
  227. print("Setting Mouse To Wait")
  228. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  229.  
  230. while not Tool.Enabled and stillEquipped do
  231. wait(.01)
  232. end
  233. end
  234. end
  235.  
  236. function onUnequippedLocal()
  237. stillEquipped = false
  238. end
  239.  
  240.  
  241. Tool.Equipped:connect(onEquippedLocal)
  242. Tool.Unequipped:connect(onUnequippedLocal)
  243.  
  244. end))
  245. Animation5.Name = "Whack"
  246. Animation5.Parent = Tool0
  247. Animation5.AnimationId = "http://www.roblox.com/Asset?ID=46151856"
  248. Camera6.Name = "ThumbnailCamera"
  249. Camera6.Parent = Tool0
  250. Camera6.CFrame = CFrame.new(-0.941516638, 5.70548439, 0.0050331275, -0.0218932275, 0.985759676, -0.166728929, -2.32830644e-10, 0.166768894, 0.985996008, 0.99976033, 0.0215866342, -0.00365110952)
  251. Camera6.CoordinateFrame = CFrame.new(-0.941516638, 5.70548439, 0.0050331275, -0.0218932275, 0.985759676, -0.166728929, -2.32830644e-10, 0.166768894, 0.985996008, 0.99976033, 0.0215866342, -0.00365110952)
  252. Camera6.Focus = CFrame.new(-0.030002594, 0.315002859, 0.0249938965, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  253. Camera6.focus = CFrame.new(-0.030002594, 0.315002859, 0.0249938965, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  254. Sound7.Name = "FishWhack"
  255. Sound7.Parent = Tool0
  256. Sound7.SoundId = "http://www.roblox.com/asset/?id=46153268"
  257. Sound7.Volume = 0
  258. for i,v in pairs(mas:GetChildren()) do
  259. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  260. pcall(function() v:MakeJoints() end)
  261. end
  262. mas:Destroy()
  263. for i,v in pairs(cors) do
  264. spawn(function()
  265. pcall(v)
  266. end)
  267. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement