Advertisement
Puppet213321

fish

Jun 8th, 2018
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.71 KB | None | 0 0
  1. -- Initial stuff
  2. math.randomseed(tick())
  3.  
  4.  
  5. -- Wait for character
  6. repeat wait() until game.Players.LocalPlayer.Character ~= nil
  7.  
  8.  
  9. -- Useful shortcuts
  10. local plr = game:GetService("Players").LocalPlayer
  11. local char = plr.Character
  12. local plrgui = plr.PlayerGui
  13. local backpack = plr.Backpack
  14. local torso = char.Torso
  15. local head = char.Head
  16. local hum = char.Humanoid
  17. local larm = char["Left Arm"]
  18. local lleg = char["Left Leg"]
  19. local rarm = char["Right Arm"]
  20. local rleg = char["Right Leg"]
  21. local LS = torso["Left Shoulder"]
  22. local LH = torso["Left Hip"]
  23. local RS = torso["Right Shoulder"]
  24. local RH = torso["Right Hip"]
  25. local neck = torso.Neck
  26. local it = Instance.new
  27. local vt = Vector3.new
  28. local cf = CFrame.new
  29. local euler = CFrame.fromEulerAnglesXYZ
  30. local angles = CFrame.Angles
  31. local neckC0 = cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  32. local neckC1 = cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  33. local LSC0 = cf(-1.5,.5,0)
  34. local LSC1 = cf(0,.5,0)
  35. local RSC0 = cf(1.5,.5,0)
  36. local RSC1 = cf(0,.5,0)
  37. local LHC0 = cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  38. local LHC1 = cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  39. local RHC0 = cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  40. local RHC1 = cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  41. local RP = char.HumanoidRootPart
  42. local RJ = RP.RootJoint
  43. local RJC0 = euler(-1.57,0,3.14)
  44.  
  45.  
  46. -- Build the weapon
  47. local build = function()
  48. local model = Instance.new("Model")
  49. model.Name = "Cane"
  50. local handle = Instance.new("Part", model)
  51. handle.FormFactor = Enum.FormFactor.Symmetric
  52. handle.CanCollide = false
  53. handle.Size = Vector3.new(1,1,3)
  54. handle.Name = "Handle"
  55. local mesh = Instance.new("SpecialMesh",handle)
  56. mesh.Scale = Vector3.new(1.9,1.9,1.9)
  57. mesh.MeshId = "http://www.roblox.com/asset/?id=419221487"
  58. mesh.TextureId = "http://www.roblox.com/asset/?id=419221538"
  59. mesh.MeshType = Enum.MeshType.FileMesh
  60. return model
  61. end
  62.  
  63.  
  64. -- Wait for mouse
  65. local mouse
  66. while true do
  67. mouse = plr:GetMouse()
  68. if mouse then break end
  69. wait(.1)
  70. end
  71.  
  72.  
  73. -- Create welds
  74. local RW, LW = Instance.new("Weld",torso), Instance.new("Weld",torso)
  75. RW.Name = "Right Weld" LW.Name = "Left Weld"
  76. RW.Part0 = torso LW.Part0 = torso
  77. RW.C0 = RSC0 RW.C1 = RSC1 LW.C0 = LSC0 LW.C1 = LSC1
  78.  
  79.  
  80. -- Attach weapon
  81. local canemodel = build()
  82. local cane = canemodel:FindFirstChild("Handle")
  83. canemodel.Parent = char
  84. local caneweld = Instance.new("Weld", rarm)
  85. caneweld.Part0 = rarm
  86. caneweld.Part1 = cane
  87. caneweldC0 = caneweld.C0 * CFrame.new(0,-1,1) * CFrame.Angles(math.rad(180),0,math.rad(90))
  88. caneweld.C0 = caneweldC0
  89.  
  90.  
  91. -- Weapon variables
  92. local caneEnd = cf(-.225,0,-1.5)
  93.  
  94.  
  95. -- Sound effects
  96.  
  97. local sounds = {}
  98. sounds.explosion = "http://www.roblox.com/asset/?id=1542642349"
  99. sounds.bewm = "http://www.roblox.com/asset/?id=0"
  100. sounds.slice = "http://www.roblox.com/asset/?id=1542642349"
  101. sounds.charge = "http://roblox.com/asset/?id=1542642349"
  102. sounds.sharpblast = "http://roblox.com/asset/?id=146163534"
  103. sounds.woosh = "http://roblox.com/asset/?id=1542642349"
  104. sounds.metalhit = "http://roblox.com/asset/?id=0"
  105. sounds.mechblast = "http://roblox.com/asset/?id=1542642349"
  106. sounds.chargepulse = "http://roblox.com/asset/?id=1542642349"
  107. sounds.heal = "http://roblox.com/asset/?id=1542642349"
  108. sounds.zap = "http://roblox.com/asset/?id=0"
  109. sounds.powernote = "http://roblox.com/asset/?id=1542642349"
  110. sounds.swing = "http://roblox.com/asset/?id=1542642349"
  111. sounds.hit = "http://roblox.com/asset/?id=0"
  112.  
  113.  
  114. -- Base functions
  115. local wait = function(t)
  116. if t ~= nil then
  117. return wait(t)
  118. else
  119. local t = tick()
  120. game:GetService("RunService").RenderStepped:wait()
  121. return tick() - t, time()
  122. end
  123. end
  124. local nolines = function(p)
  125. p.TopSurface, p.BottomSurface, p.LeftSurface, p.RightSurface, p.FrontSurface, p.BackSurface = 10, 10, 10, 10, 10, 10
  126. end
  127. local part = function(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  128. local fp = it("Part")
  129. fp.formFactor = formfactor
  130. fp.Parent = parent
  131. fp.Reflectance = reflectance
  132. fp.Transparency = transparency
  133. fp.CanCollide = false
  134. fp.Locked = true
  135. fp.BrickColor = brickcolor
  136. fp.Name = name
  137. fp.Size = size
  138. fp.Position = torso.Position
  139. fp.Material = "SmoothPlastic"
  140. fp:BreakJoints()
  141. nolines(fp)
  142. return fp
  143. end
  144. local mesh = function(instance,part,meshtype,meshid,offset,scale)
  145. local mesh = it(instance)
  146. mesh.Parent = part
  147. if instance == "SpecialMesh" then
  148. mesh.MeshType = meshtype
  149. if meshid ~= nil then
  150. mesh.MeshId = "http://www.roblox.com/asset/?id="..meshid
  151. end
  152. end
  153. mesh.Offset=offset
  154. mesh.Scale=scale
  155. return mesh
  156. end
  157. local weld = function(parent,part0,part1,c0)
  158. local weld = it("Weld")
  159. weld.Parent = parent
  160. weld.Part0 = part0
  161. weld.Part1 = part1
  162. weld.C0 = c0
  163. return weld
  164. end
  165. local rayCast = function(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  166. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  167. end
  168. local rad = function(x,y,z)
  169. return euler(math.rad(x or 0),math.rad(y or 0),math.rad(z or 0))
  170. end
  171. local random = function(a, b)
  172. local num = math.random(a*100, b*100)
  173. return num/100
  174. end
  175. local randomRot = function()
  176. return rad(random(0,360),random(0,360),random(0,360))
  177. end
  178. local sound = function(id, par, vol, pit)
  179. coroutine.resume(coroutine.create(function()
  180. local sou = Instance.new("Sound", par or workspace)
  181. sou.Volume = vol
  182. --sou.Pitch = pit or 1
  183. sou.SoundId = id
  184. wait()
  185. sou:play()
  186. game:GetService("Debris"):AddItem(sou, 6)
  187. end))
  188. end
  189. local damage = function(hit, minim, maxim, knockback, Type, Property, Delay, KnockbackType, incstun, stagger, staghit, ranged)
  190. -- Fen's nasty and messy damage function
  191. if hit.Parent == nil then
  192. return
  193. end
  194. local h =
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement