bubnake

GOOFY ANIMATION :D

Aug 30th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. Player=game:GetService("Players").LocalPlayer
  2. Character=Player.Character
  3. PlayerGui=Player.PlayerGui
  4. Backpack=Player.Backpack
  5. Torso=Character.Torso
  6. Head=Character.Head
  7. Humanoid=Character.Humanoid
  8. LeftArm=Character["Left Arm"]
  9. LeftLeg=Character["Left Leg"]
  10. RightArm=Character["Right Arm"]
  11. RightLeg=Character["Right Leg"]
  12. LS=Torso["Left Shoulder"]
  13. LH=Torso["Left Hip"]
  14. RS=Torso["Right Shoulder"]
  15. RH=Torso["Right Hip"]
  16. Face = Head.face
  17. Neck=Torso.Neck
  18. it=Instance.new
  19. attacktype=1
  20. vt=Vector3.new
  21. cf=CFrame.new
  22. euler=CFrame.fromEulerAnglesXYZ
  23. angles=CFrame.Angles
  24. cloaked=false
  25. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  26. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  27. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  28. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  29. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  30. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  31. RootPart=Character.HumanoidRootPart
  32. RootJoint=RootPart.RootJoint
  33. RootCF=euler(-1.57,0,3.14)
  34. attack = false
  35. attackdebounce = false
  36. deb=false
  37. equipped=true
  38. hand=false
  39. MMouse=nil
  40. combo=0
  41. mana=0
  42. trispeed=.2
  43. attackmode='none'
  44. local idle=0
  45. local Anim="Idle"
  46. local Effects={}
  47. local gun=false
  48. local shoot=false
  49. player=nil
  50. mana=0
  51. cam = workspace.CurrentCamera
  52. ZTarget = nil
  53. RocketTarget = nil
  54. local m = Instance.new("Model",Character)
  55. m.Name = "WeaponModel"
  56.  
  57. mouse=Player:GetMouse()
  58. --save shoulders
  59. RSH, LSH=nil, nil
  60. --welds
  61. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  62. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  63. LH=Torso["Left Hip"]
  64. RH=Torso["Right Hip"]
  65. TorsoColor=Torso.BrickColor
  66. function NoOutline(Part)
  67. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  68. end
  69. player=Player
  70. ch=Character
  71. RSH=ch.Torso["Right Shoulder"]
  72. LSH=ch.Torso["Left Shoulder"]
  73. --
  74. RSH.Parent=nil
  75. LSH.Parent=nil
  76. --
  77. RW.Name="Right Shoulder"
  78. RW.Part0=ch.Torso
  79. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  80. RW.C1=cf(0, 0.5, 0)
  81. RW.Part1=ch["Right Arm"]
  82. RW.Parent=ch.Torso
  83. --
  84. LW.Name="Left Shoulder"
  85. LW.Part0=ch.Torso
  86. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  87. LW.C1=cf(0, 0.5, 0)
  88. LW.Part1=ch["Left Arm"]
  89. LW.Parent=ch.Torso
  90.  
  91.  
  92. local RbxUtility = LoadLibrary("RbxUtility")
  93. local Create = RbxUtility.Create
  94.  
  95. function RemoveOutlines(part)
  96. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  97. end
  98.  
  99. function CreatePart(FormFactor, Parent, Material, Reflectance, Transparency, BrickColor, Name, Size)
  100. local Part = Create("Part"){
  101. formFactor = FormFactor,
  102. Parent = Parent,
  103. Reflectance = Reflectance,
  104. Transparency = Transparency,
  105. CanCollide = false,
  106. Locked = true,
  107. BrickColor = BrickColor.new(tostring(BrickColor)),
  108. Name = Name,
  109. Size = Size,
  110. Material = Material,
  111. }
  112. RemoveOutlines(Part)
  113. end
  114.  
  115. function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  116. local Msh = Create(Mesh){
  117. Parent = Part,
  118. Offset = OffSet,
  119. Scale = Scale,
  120. }
  121. if Mesh == "SpecialMesh" then
  122. Msh.MeshType = MeshType
  123. Msh.MeshId = MeshId
  124. end
  125. end
  126.  
  127. function CreateWeld(Parent, Part0, Part1, C0, C1)
  128. local Weld = Create("Weld"){
  129. Parent = Parent,
  130. Part0 = Part0,
  131. Part1 = Part1,
  132. C0 = C0,
  133. C1 = C1,
  134. }
  135. end
  136.  
  137. so = function(id,par,vol,pit)
  138. coroutine.resume(coroutine.create(function()
  139. local sou = Instance.new("Sound",par or workspace)
  140. sou.Volume=vol
  141. sou.Pitch=pit or 1
  142. sou.SoundId=id
  143. wait()
  144. sou:play()
  145. game:GetService("Debris"):AddItem(sou,6)
  146. end))
  147. end
  148.  
  149. function clerp(a,b,t)
  150. return a:lerp(b,t)
  151. end
  152.  
  153. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  154. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  155. end
  156.  
  157. function attackone()
  158. attack = true
  159. for i = 0,1,0.1 do
  160. wait()
  161. end
  162. attack = false
  163. end
  164.  
  165. mouse.Button1Down:connect(function()
  166. if attack == false and attacktype == 1 then
  167. attacktype = 1
  168. attackone()
  169. end
  170. end)
  171.  
  172. mouse.KeyDown:connect(function(k)
  173. k=k:lower()
  174. if attack == false and k == '' then
  175.  
  176. end
  177. end)
  178.  
  179.  
  180. local sine = 0
  181. local change = 1
  182. local val = 0
  183.  
  184. while true do
  185. wait()
  186. sine = sine + change
  187. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  188. local velderp=RootPart.Velocity.y
  189. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  190. if equipped==true or equipped==false then
  191. if attack==false then
  192. idle=idle+1
  193. else
  194. idle=0
  195. end
  196. if idle>=500 then
  197. if attack==false then
  198. end
  199. end
  200. if RootPart.Velocity.y > 1 and hitfloor==nil then
  201. Anim="Jump"
  202. if attack==false then
  203. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(0,0,0),.3)
  204. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(0,0,0),.3)
  205. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(0,0,0), 0.3)
  206. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(0,0,0), 0.3)
  207. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(0,0,0),.3)
  208. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(0,0,0),.3)
  209. end
  210. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  211. Anim="Fall"
  212. if attack==false then
  213. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(0,0,0),.3)
  214. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(0,0,0),.3)
  215. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(0,0,0), 0.3)
  216. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(0,0,0), 0.3)
  217. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(0,0,0),.3)
  218. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(0,0,0),.3)
  219. end
  220. elseif torvel<1 and hitfloor~=nil then
  221. Anim="Idle"
  222. if attack==false then
  223. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(0,0,0),.3)
  224. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(0,0,0),.3)
  225. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(0,0,0), 0.3)
  226. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(0,0,0), 0.3)
  227. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(0,0,0),.3)
  228. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(0,0,0),.3)
  229. end
  230. elseif torvel>2 and hitfloor~=nil then
  231. Anim="Walk"
  232. if attack==false then
  233. change=3
  234. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(0,0,0),.3)
  235. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(0,0,0),.3)
  236. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(0,0,0), 0.3)
  237. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(0,0,0), 0.3)
  238. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(0,0,0),.3)
  239. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(0,0,0),.3)
  240. end
  241. end
  242. end
  243. if #Effects>0 then
  244. for e=1,#Effects do
  245. if Effects[e]~=nil then
  246. local Thing=Effects[e]
  247. if Thing~=nil then
  248. local Part=Thing[1]
  249. local Mode=Thing[2]
  250. local Delay=Thing[3]
  251. local IncX=Thing[4]
  252. local IncY=Thing[5]
  253. local IncZ=Thing[6]
  254. if Thing[1].Transparency<=1 then
  255. if Thing[2]=="Block1" then
  256. Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  257. Mesh=Thing[1].Mesh
  258. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  259. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  260. elseif Thing[2]=="Cylinder" then
  261. Mesh=Thing[1].Mesh
  262. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  263. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  264. elseif Thing[2]=="Blood" then
  265. Mesh=Thing[7]
  266. Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0)
  267. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  268. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  269. elseif Thing[2]=="Elec" then
  270. Mesh=Thing[1].Mesh
  271. Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
  272. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  273. elseif Thing[2]=="Disappear" then
  274. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  275. end
  276. else
  277. Part.Parent=nil
  278. table.remove(Effects,e)
  279. end
  280. end
  281. end
  282. end
  283. end
  284. end
Add Comment
Please, Sign In to add comment