cat568

Untitled

Jan 14th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --just put this on the top of a script and boom 89% works
  2. --note this does not work on big scripts
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. for _,t in pairs(CAS.Actions) do
  52. for _,k in pairs(t.Keys) do
  53. if k==io.KeyCode then
  54. t.Function(t.Name,io.UserInputState,io)
  55. end
  56. end
  57. end
  58. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  59. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  60. end
  61. end)
  62. Event.Parent = NLS([==[
  63. local Player = game:GetService("Players").LocalPlayer
  64. local Event = script:WaitForChild("UserInput_Event")
  65.  
  66. local Mouse = Player:GetMouse()
  67. local UIS = game:GetService("UserInputService")
  68. local input = function(io,a)
  69. if a then return end
  70. --Since InputObject is a client-side instance, we create and pass table instead
  71. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  72. end
  73. UIS.InputBegan:Connect(input)
  74. UIS.InputEnded:Connect(input)
  75.  
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then return s[k] end
  95. end,
  96. __newindex = function(self,k,v)
  97. local s = rawget(self,"_RealService")
  98. if s then s[k]=v end
  99. end,
  100. __call = function(self,...)
  101. local s = rawget(self,"_RealService")
  102. if s then return s(...) end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return self[s]
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. }
  121. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  122. g.service = g.GetService
  123.  
  124. g.RunService = FakeService({
  125. RenderStepped = _rg:GetService("RunService").Heartbeat,
  126. BindToRenderStep = function(self,name,_,fun)
  127. self._btrs[name] = self.Heartbeat:Connect(fun)
  128. end,
  129. UnbindFromRenderStep = function(self,name)
  130. self._btrs[name]:Disconnect()
  131. end,
  132. },"RunService")
  133.  
  134. setmetatable(g,{
  135. __index=function(self,s)
  136. return _rg:GetService(s) or typeof(_rg[s])=="function"
  137. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  138. end,
  139. __newindex = fsmt.__newindex,
  140. __call = fsmt.__call
  141. })
  142. --Changing owner to fake player object to support owner:GetMouse()
  143. game,owner = g,g.Players.LocalPlayer
  144. end
  145.  
  146.  
  147.  
  148. --[[qaeo baeo haeo]]--
  149. wait(1 / 60)
  150. Effects = { }
  151. local Player = game.Players.localPlayer
  152. local Character = Player.Character
  153. local Humanoid = Character.Humanoid
  154. local mouse = Player:GetMouse()
  155. local m = Instance.new('Model', Character)
  156. m.Name = "WeaponModel"
  157. Character["Left Arm"]:remove()
  158. Character["Right Arm"]:remove()
  159. Character["Left Leg"]:remove()
  160. Character["Right Leg"]:remove()
  161. local Head = Character.Head
  162. local Torso = Character.Torso
  163. local cam = game.Workspace.CurrentCamera
  164. local RootPart = Character.HumanoidRootPart
  165. local RootJoint = RootPart.RootJoint
  166. local equipped = false
  167. local attack = false
  168. local Anim = 'Idle'
  169. local idle = 0
  170. local attacktype = 1
  171. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  172. local velocity = RootPart.Velocity.y
  173. local sine = 0
  174. local change = 1
  175. local mana = 0
  176. local it =Instance.new
  177. vt=Vector3.new
  178. local grabbed = false
  179. local cf = CFrame.new
  180. local mr = math.rad
  181. local angles = CFrame.Angles
  182. local ud = UDim2.new
  183. local c3 = Color3.new
  184. for i,v in pairs(Character:GetChildren()) do
  185. if v:IsA("Accessory") then
  186. v:Destroy()
  187. end
  188. end
  189. local NeckCF = cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  190. Humanoid.Animator:Destroy()
  191. Character.Animate:Destroy()
  192. Head.Transparency = 1
  193. Torso.Transparency = 1
  194. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  195. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  196. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  197.  
  198. Head.face:remove()
  199. function clerp(a, b, t)
  200. return a:lerp(b, t)
  201. end
  202.  
  203.  
  204. local RbxUtility = LoadLibrary("RbxUtility")
  205. local Create = RbxUtility.Create
  206.  
  207. function RemoveOutlines(part)
  208. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  209. end
  210.  
  211. function CreatePart(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  212. local Part = Create("Part"){
  213. Parent = Parent,
  214. Reflectance = Reflectance,
  215. Transparency = Transparency,
  216. CanCollide = false,
  217. Locked = true,
  218. BrickColor = BrickColor.new(tostring(BColor)),
  219. Name = Name,
  220. Size = Size,
  221. Material = Material,
  222. }
  223. RemoveOutlines(Part)
  224. return Part
  225. end
  226.  
  227. function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  228. local Msh = Create(Mesh){
  229. Parent = Part,
  230. Offset = OffSet,
  231. Scale = Scale,
  232. }
  233. if Mesh == "SpecialMesh" then
  234. Msh.MeshType = MeshType
  235. Msh.MeshId = MeshId
  236. end
  237. return Msh
  238. end
  239.  
  240. --[[Credits to SazErenos for his Artificial Heartbeat]]--
  241.  
  242. ArtificialHB = Instance.new("BindableEvent", script)
  243. ArtificialHB.Name = "Heartbeat"
  244.  
  245. script:WaitForChild("Heartbeat")
  246.  
  247. frame = 1 / 30
  248. tf = 0
  249. allowframeloss = false
  250. tossremainder = false
  251. lastframe = tick()
  252. script.Heartbeat:Fire()
  253.  
  254. game:GetService("RunService").Heartbeat:connect(function(s, p)
  255. tf = tf + s
  256. if tf >= frame then
  257. if allowframeloss then
  258. script.Heartbeat:Fire()
  259. lastframe = tick()
  260. else
  261. for i = 1, math.floor(tf / frame) do
  262. script.Heartbeat:Fire()
  263. end
  264. lastframe = tick()
  265. end
  266. if tossremainder then
  267. tf = 0
  268. else
  269. tf = tf - frame * math.floor(tf / frame)
  270. end
  271. end
  272. end)
  273.  
  274. function swait(num)
  275. if num == 0 or num == nil then
  276. ArtificialHB.Event:wait()
  277. else
  278. for i = 0, num do
  279. ArtificialHB.Event:wait()
  280. end
  281. end
  282. end
  283.  
  284.  
  285. function CreateWeld(Parent, Part0, Part1, C0, C1)
  286. local Weld = Create("Weld"){
  287. Parent = Parent,
  288. Part0 = Part0,
  289. Part1 = Part1,
  290. C0 = C0,
  291. C1 = C1,
  292. }
  293. return Weld
  294. end
  295.  
  296. function rayCast(Position, Direction, Range, Ignore)
  297. return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  298. end
  299.  
  300. function CreateSound(id, par, vol, pit)
  301. coroutine.resume(coroutine.create(function()
  302. local sou = Instance.new("Sound", par or workspace)
  303. sou.Volume = vol
  304. sou.Pitch = pit or 1
  305. sou.SoundId = id
  306. swait()
  307. sou:play()
  308. game:GetService("Debris"):AddItem(sou, 6)
  309. end))
  310. end
  311.  
  312.  
  313. Handle=CreatePart(m,Enum.Material.Plastic,0.10000000149012,0,"Really black","Handle",Vector3.new(1, 1, 1))
  314. HandleWeld=CreateWeld(m,Character["Torso"],Handle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0199661255, -0.0400784016, 0.15832901, 1, -5.67096185e-006, -2.38577304e-005, 5.6816225e-006, 0.999999344, 0.000446140766, 2.38577395e-005, -0.000446140766, 0.999999344))
  315. Tock=CreatePart(m,Enum.Material.Plastic,0,0,"Medium stone grey","Tock",Vector3.new(1, 1, 1))
  316. TockWeld=CreateWeld(m,Handle,Tock,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-3.81469727e-006, -0.699996948, 7.00950623e-005, 1, 2.04636308e-011, 7.80528353e-008, -7.29414751e-008, 1.35121719e-010, 0.999998868, -2.04636308e-011, -0.999998868, -1.35550668e-010))
  317. CreateMesh("CylinderMesh",Tock,"","",Vector3.new(0, 0, 0),Vector3.new(0.150000006, 0.75, 1))
  318. Tick=CreatePart(m,Enum.Material.Plastic,0,0,"Medium stone grey","Tick",Vector3.new(1, 1, 1))
  319. TickWeld=CreateWeld(m,Tock,Tick,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.300003052, 0.200067759, 0, 7.80528353e-008, 0.999998868, -1.35550668e-010, 2.04636308e-011, 1.35121719e-010, -0.999998868, -1, 7.29414751e-008, 2.04636308e-011))
  320. CreateMesh("SpecialMesh",Tick,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.400000006, 0.400000006, 1.20000005))
  321. Tick=CreatePart(m,Enum.Material.Plastic,0,0,"Medium stone grey","Tick",Vector3.new(1, 1, 1))
  322. TickWeld=CreateWeld(m,Tock,Tick,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.300003052, -0.199929476, -3.81469727e-006, 7.80528353e-008, 0.999998868, -1.35550668e-010, 2.04636308e-011, 1.35121719e-010, -0.999998868, -1, 7.29414751e-008, 2.04636308e-011))
  323. CreateMesh("SpecialMesh",Tick,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.400000006, 0.400000006, 1.20000005))
  324. CreateMesh("SpecialMesh",Handle,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1.5, 1.5, 1.5))
  325. Part=CreatePart(m,Enum.Material.Plastic,0,0,"Institutional white","Part",Vector3.new(0.540000021, 0.200000003, 0.460000038))
  326. PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0200805664, -0.737700462, 0, -2.19000867e-007, -0.422617674, 0.906307518, -2.3091161e-007, 0.906307518, 0.422617704, -1, -1.16742285e-007, -2.98621671e-007))
  327. CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  328. LeftPeg=CreatePart(m,Enum.Material.Plastic,0,0,"Bright yellow","LeftPeg",Vector3.new(1, 0.560000002, 1))
  329. LeftPegWeld=CreateWeld(m,Handle,LeftPeg,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.399997711, 0.779884815, 7.62939453e-006, 1, -4.36907612e-008, -4.11564542e-008, 4.372896e-008, 0.999999404, 1.54743116e-008, 4.62659955e-008, -1.53474389e-008, 0.999999404))
  330. CreateMesh("SpecialMesh",LeftPeg,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(0.800000012, 0.75, 0.949999988))
  331. Part=CreatePart(m,Enum.Material.Plastic,0.10000000149012,0,"Institutional white","Part",Vector3.new(0.200000003, 1.13999999, 0.590000033))
  332. PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.219978333, -0.00736188889, 0.492553711, 1, 5.67091502e-006, -1.42244971e-007, -5.44018985e-006, 0.965925276, 0.258818746, 1.60760464e-006, -0.258818775, 0.965925276))
  333. CreateMesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.649999976, 1))
  334. Part=CreatePart(m,Enum.Material.Plastic,0.10000000149012,0,"Institutional white","Part",Vector3.new(0.200000003, 1.13999999, 0.590000033))
  335. PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.189998627, -0.00735902786, 0.49256134, 1, 5.67091502e-006, -1.42244971e-007, -5.44018985e-006, 0.965925276, 0.258818746, 1.60760464e-006, -0.258818775, 0.965925276))
  336. CreateMesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.649999976, 1))
  337. Poot=CreatePart(m,Enum.Material.Plastic,0,0,"Mid gray","Part",Vector3.new(0.200000003, 0.219999999, 0.200000003))
  338. PartWeld=CreateWeld(m,Handle,Poot,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.502023697, -1.00622749, 0, -9.02868123e-006, -0.81915164, 0.573576152, 2.20012589e-006, 0.573576152, 0.81915164, -1, 8.65777929e-006, -3.37895472e-006))
  339. CreateMesh("CylinderMesh",Poot,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.5))
  340. Part=CreatePart(m,Enum.Material.Plastic,0,0,"Mid gray","Part",Vector3.new(0.200000003, 0.219999999, 0.200000003))
  341. PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0188560486, -0.944825172, 0, -1.92190091e-005, -0.422617674, 0.906307518, 1.27690937e-005, 0.906307518, 0.422617704, -1, 1.96949968e-005, -1.20244413e-005))
  342. CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.5))
  343. RightPeg=CreatePart(m,Enum.Material.Plastic,0,0,"Bright yellow","RightPeg",Vector3.new(1, 0.570000052, 1))
  344. RightPegWeld=CreateWeld(m,Handle,RightPeg,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.400005341, 0.784877062, 1.14440918e-005, 1, -4.36907612e-008, -4.11564542e-008, 4.372896e-008, 0.999999404, 1.54743116e-008, 4.62659955e-008, -1.53474389e-008, 0.999999404))
  345. CreateMesh("SpecialMesh",RightPeg,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(0.800000012, 0.75, 0.949999988))
  346. Part=CreatePart(m,Enum.Material.Plastic,0,0,"Mid gray","Part",Vector3.new(0.200000003, 0.219999999, 0.200000003))
  347. PartWeld=CreateWeld(m,Handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.853747368, -0.98065567, 3.81469727e-006, -4.15784598e-008, -0.965925038, 0.258818835, 1.37861207e-008, 0.258818835, 0.965925038, -1, 4.36907612e-008, -2.55568011e-009))
  348. CreateMesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.5))
  349.  
  350. function boom()
  351. attack = true
  352. d=Instance.new("Fire",Poot)
  353. d.Heat=0
  354. d.Size=2
  355. CreateSound("http://www.roblox.com/asset/?id=138931042",Torso,1,1)
  356. for i = 0, 1, 0.05 do
  357. swait()
  358. if Torsovelocity > 2 then
  359. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  360. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  361. else
  362. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  363. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  364. end
  365. Handle.BrickColor=BrickColor.new("Bright red")
  366. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  367. end
  368. for i = 0, 1, 0.05 do
  369. swait()
  370. if Torsovelocity > 2 then
  371. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  372. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  373. else
  374. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  375. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  376. end
  377. Handle.BrickColor=BrickColor.new("Black")
  378. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  379. end
  380. for i = 0, 1, 0.1 do
  381. swait()
  382. if Torsovelocity > 2 then
  383. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  384. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  385. else
  386. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  387. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  388. end
  389. Handle.BrickColor=BrickColor.new("Bright red")
  390. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  391. end
  392. for i = 0, 1, 0.1 do
  393. swait()
  394. if Torsovelocity > 2 then
  395. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  396. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  397. else
  398. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  399. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  400. end
  401. Handle.BrickColor=BrickColor.new("Black")
  402. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  403. end
  404. for i = 0, 1, 0.2 do
  405. swait()
  406. if Torsovelocity > 2 then
  407. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  408. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  409. else
  410. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  411. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  412. end
  413. Handle.BrickColor=BrickColor.new("Bright red")
  414. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  415. end
  416. for i = 0, 1, 0.2 do
  417. swait()
  418. if Torsovelocity > 2 then
  419. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  420. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  421. else
  422. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  423. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  424. end
  425. Handle.BrickColor=BrickColor.new("Black")
  426. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  427. end
  428. for i = 0, 1, 0.5 do
  429. swait()
  430. if Torsovelocity > 2 then
  431. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  432. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  433. else
  434. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  435. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  436. end
  437. Handle.BrickColor=BrickColor.new("Bright red")
  438. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  439. end
  440. for i = 0, 1, 0.5 do
  441. swait()
  442. if Torsovelocity > 2 then
  443. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  444. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  445. else
  446. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  447. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  448. end
  449. Handle.BrickColor=BrickColor.new("Black")
  450. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  451. end
  452. for i = 0, 1, 0.5 do
  453. swait()
  454. if Torsovelocity > 2 then
  455. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  456. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  457. else
  458. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  459. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  460. end
  461. Handle.BrickColor=BrickColor.new("Bright red")
  462. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  463. end
  464. for i = 0, 1, 0.5 do
  465. swait()
  466. if Torsovelocity > 2 then
  467. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  468. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  469. else
  470. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  471. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  472. end
  473. Handle.BrickColor=BrickColor.new("Black")
  474. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  475. end
  476. CreateSound("http://www.roblox.com/asset/?id=282185588",Torso,1,1)
  477. gg=Instance.new("Explosion")
  478. gg.Parent=Torso
  479. gg.Position=Torso.Position
  480. attack = false
  481. end
  482.  
  483. --[[Attacks]]--
  484.  
  485. mouse.Button1Down:connect(function()
  486. if attack == false and attacktype == 1 then
  487. boom()
  488. end
  489. end)
  490.  
  491.  
  492. Humanoid.WalkSpeed=10
  493. --[[ Movement Detection ]]--
  494. j=1
  495. while true do
  496. swait()
  497. if j == 360 then
  498. j=1
  499. else
  500. j=j+5
  501. end
  502. Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  503. velocity = RootPart.Velocity.y
  504. sine = sine + change
  505. local hit, pos = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character)
  506. if equipped == true or equipped == false then
  507. if RootPart.Velocity.y > 1 and hit == nil then
  508. Anim = "Jump"
  509. if attack == false then
  510.  
  511. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  512. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  513. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  514. end
  515. elseif RootPart.Velocity.y < -1 and hit == nil then
  516. Anim = "Fall"
  517. if attack == false then
  518.  
  519. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  520. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  521. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  522. end
  523. elseif Torsovelocity < 1 and hit ~= nil then
  524. Anim = "Idle"
  525. if attack == false then
  526. change = 1
  527. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  528. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  529. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  530. end
  531. elseif Torsovelocity > 2 and hit ~= nil then
  532. Anim = "Walk"
  533. if attack == false then
  534. RightPegWeld.C0 = clerp(RightPegWeld.C0, CFrame.new(0,0, 0+.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  535. LeftPegWeld.C0 = clerp(LeftPegWeld.C0, CFrame.new(0,0, 0-.2* math.cos(sine / 3)) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  536. TockWeld.C0 = clerp(TockWeld.C0, CFrame.new(0,0, 0) * angles(math.rad(0), math.rad(0), math.rad(0+j)), .3)
  537. end
  538. end
  539. end
  540. if #Effects > 0 then
  541. for e = 1, #Effects do
  542. if Effects[e] ~= nil then
  543. local Thing = Effects[e]
  544. if Thing ~= nil then
  545. local Part = Thing[1]
  546. local Mode = Thing[2]
  547. local Delay = Thing[3]
  548. local IncX = Thing[4]
  549. local IncY = Thing[5]
  550. local IncZ = Thing[6]
  551. if Thing[1].Transparency <= 1 then
  552. if Thing[2] == "Block1" then
  553. Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  554. Mesh = Thing[1].Mesh
  555. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  556. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  557. elseif Thing[2] == "Block2" then
  558. Thing[1].CFrame = Thing[1].CFrame
  559. Mesh = Thing[7]
  560. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  561. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  562. elseif Thing[2] == "Cylinder" then
  563. Mesh = Thing[1].Mesh
  564. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  565. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  566. elseif Thing[2] == "Blood" then
  567. Mesh = Thing[7]
  568. Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, .5, 0)
  569. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  570. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  571. elseif Thing[2] == "Elec" then
  572. Mesh = Thing[1].Mesh
  573. Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
  574. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  575. elseif Thing[2] == "Disappear" then
  576. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  577. elseif Thing[2] == "Shatter" then
  578. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  579. Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
  580. Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  581. Thing[6] = Thing[6] + Thing[5]
  582. end
  583. else
  584. Part.Parent = nil
  585. table.remove(Effects, e)
  586. end
  587. end
  588. end
  589. end
  590. end
  591. end
Advertisement
Add Comment
Please, Sign In to add comment