Advertisement
iiJosephCats205

big

Sep 26th, 2019
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.41 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84.  
  85. Player=owner
  86. Character=Player.Character
  87. PlayerGui=Player.PlayerGui
  88. Backpack=Player.Backpack
  89. Torso=Character.Torso
  90. Head=Character.Head
  91. Humanoid=Character.Humanoid
  92. LeftArm=Character["Left Arm"]
  93. LeftLeg=Character["Left Leg"]
  94. RightArm=Character["Right Arm"]
  95. RightLeg=Character["Right Leg"]
  96. LS=Torso["Left Shoulder"]
  97. LH=Torso["Left Hip"]
  98. RS=Torso["Right Shoulder"]
  99. RH=Torso["Right Hip"]
  100. Face = Head.face
  101. Neck=Torso.Neck
  102. it=Instance.new
  103. attacktype=1
  104. vt=Vector3.new
  105. cf=CFrame.new
  106. euler=CFrame.fromEulerAnglesXYZ
  107. angles=CFrame.Angles
  108. cloaked=false
  109. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  110. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  111. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  112. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  113. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  114. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  115. RootPart=Character.HumanoidRootPart
  116. RootJoint=RootPart.RootJoint
  117. RootCF=euler(-1.57,0,3.14)
  118. attack = false
  119. attackdebounce = false
  120. deb=false
  121. equipped=true
  122. hand=false
  123. MMouse=nil
  124. combo=0
  125. mana=0
  126. trispeed=.2
  127. attackmode='none'
  128. local idle=0
  129. local Anim="Idle"
  130. local Effects={}
  131. local gun=false
  132. local shoot=false
  133. player=nil
  134. mana=0
  135. cam = workspace.CurrentCamera
  136. ZTarget = nil
  137. RocketTarget = nil
  138. local m = Instance.new("Model",Character)
  139. m.Name = "WeaponModel"
  140.  
  141. --save shoulders
  142. RSH, LSH=nil, nil
  143. --welds
  144. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  145. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  146. LH=Torso["Left Hip"]
  147. RH=Torso["Right Hip"]
  148. TorsoColor=Torso.BrickColor
  149. function NoOutline(Part)
  150. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  151. end
  152. player=Player
  153. ch=Character
  154. RSH=ch.Torso["Right Shoulder"]
  155. LSH=ch.Torso["Left Shoulder"]
  156. --
  157. RSH.Parent=nil
  158. LSH.Parent=nil
  159. --
  160. RW.Name="Right Shoulder"
  161. RW.Part0=ch.Torso
  162. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  163. RW.C1=cf(0, 0.5, 0)
  164. RW.Part1=ch["Right Arm"]
  165. RW.Parent=ch.Torso
  166. --
  167. LW.Name="Left Shoulder"
  168. LW.Part0=ch.Torso
  169. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  170. LW.C1=cf(0, 0.5, 0)
  171. LW.Part1=ch["Left Arm"]
  172. LW.Parent=ch.Torso
  173.  
  174. function swait(num)
  175. if num==0 or num==nil then
  176. game:service'RunService'.Heartbeat:wait(0)
  177. else
  178. for i=0,num do
  179. game:service'RunService'.Heartbeat:wait(0)
  180. end
  181. end
  182. end
  183.  
  184. function nooutline(part)
  185. part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
  186. end
  187.  
  188. function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
  189. local fp=it("Part")
  190. fp.formFactor=formfactor
  191. fp.Parent=parent
  192. fp.Reflectance=reflectance
  193. fp.Transparency=transparency
  194. fp.CanCollide=false
  195. fp.Locked=true
  196. fp.BrickColor=BrickColor.new(tostring(brickcolor))
  197. fp.Name=name
  198. fp.Size=size
  199. fp.Position=Character.Torso.Position
  200. nooutline(fp)
  201. fp.Material=material
  202. fp:BreakJoints()
  203. return fp
  204. end
  205.  
  206. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  207. local mesh=it(Mesh)
  208. mesh.Parent=part
  209. if Mesh=="SpecialMesh" then
  210. mesh.MeshType=meshtype
  211. mesh.MeshId=meshid
  212. end
  213. mesh.Offset=offset
  214. mesh.Scale=scale
  215. return mesh
  216. end
  217.  
  218. function weld(parent,part0,part1,c0,c1)
  219. local weld=it("Weld")
  220. weld.Parent=parent
  221. weld.Part0=part0
  222. weld.Part1=part1
  223. weld.C0=c0
  224. weld.C1=c1
  225. return weld
  226. end
  227.  
  228.  
  229. local function CFrameFromTopBack(at, top, back)
  230. local right = top:Cross(back)
  231. return CFrame.new(at.x, at.y, at.z,
  232. right.x, top.x, back.x,
  233. right.y, top.y, back.y,
  234. right.z, top.z, back.z)
  235. end
  236.  
  237. function Triangle(a, b, c)
  238. local edg1 = (c-a):Dot((b-a).unit)
  239. local edg2 = (a-b):Dot((c-b).unit)
  240. local edg3 = (b-c):Dot((a-c).unit)
  241. if edg1 <= (b-a).magnitude and edg1 >= 0 then
  242. a, b, c = a, b, c
  243. elseif edg2 <= (c-b).magnitude and edg2 >= 0 then
  244. a, b, c = b, c, a
  245. elseif edg3 <= (a-c).magnitude and edg3 >= 0 then
  246. a, b, c = c, a, b
  247. else
  248. assert(false, "unreachable")
  249. end
  250.  
  251. local len1 = (c-a):Dot((b-a).unit)
  252. local len2 = (b-a).magnitude - len1
  253. local width = (a + (b-a).unit*len1 - c).magnitude
  254.  
  255. local maincf = CFrameFromTopBack(a, (b-a):Cross(c-b).unit, -(b-a).unit)
  256.  
  257. local list = {}
  258.  
  259. local TrailColor = ("Dark grey")
  260.  
  261. if len1 > 0.01 then
  262. local w1 = Instance.new('WedgePart', m)
  263. game:GetService("Debris"):AddItem(w1,5)
  264. w1.Material = "SmoothPlastic"
  265. w1.FormFactor = 'Custom'
  266. w1.BrickColor = BrickColor.new(TrailColor)
  267. w1.Transparency = 0
  268. w1.Reflectance = 0
  269. w1.Material = "SmoothPlastic"
  270. w1.CanCollide = false
  271. NoOutline(w1)
  272. local sz = Vector3.new(0.2, width, len1)
  273. w1.Size = sz
  274. local sp = Instance.new("SpecialMesh",w1)
  275. sp.MeshType = "Wedge"
  276. sp.Scale = Vector3.new(0,1,1) * sz/w1.Size
  277. w1:BreakJoints()
  278. w1.Anchored = true
  279. w1.Parent = workspace
  280. w1.Transparency = 0.7
  281. table.insert(Effects,{w1,"Disappear",.01})
  282. w1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  283. table.insert(list,w1)
  284. end
  285.  
  286. if len2 > 0.01 then
  287. local w2 = Instance.new('WedgePart', m)
  288. game:GetService("Debris"):AddItem(w2,5)
  289. w2.Material = "SmoothPlastic"
  290. w2.FormFactor = 'Custom'
  291. w2.BrickColor = BrickColor.new(TrailColor)
  292. w2.Transparency = 0
  293. w2.Reflectance = 0
  294. w2.Material = "SmoothPlastic"
  295. w2.CanCollide = false
  296. NoOutline(w2)
  297. local sz = Vector3.new(0.2, width, len2)
  298. w2.Size = sz
  299. local sp = Instance.new("SpecialMesh",w2)
  300. sp.MeshType = "Wedge"
  301. sp.Scale = Vector3.new(0,1,1) * sz/w2.Size
  302. w2:BreakJoints()
  303. w2.Anchored = true
  304. w2.Parent = workspace
  305. w2.Transparency = 0.7
  306. table.insert(Effects,{w2,"Disappear",.01})
  307. w2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  308. table.insert(list,w2)
  309. end
  310. return unpack(list)
  311. end
  312.  
  313.  
  314. so = function(id,par,vol,pit)
  315. coroutine.resume(coroutine.create(function()
  316. local sou = Instance.new("Sound",par or workspace)
  317. sou.Volume=vol
  318. sou.Pitch=pit or 1
  319. sou.SoundId=id
  320. swait()
  321. sou:play()
  322. game:GetService("Debris"):AddItem(sou,6)
  323. end))
  324. end
  325.  
  326. function clerp(a,b,t)
  327. local qa = {QuaternionFromCFrame(a)}
  328. local qb = {QuaternionFromCFrame(b)}
  329. local ax, ay, az = a.x, a.y, a.z
  330. local bx, by, bz = b.x, b.y, b.z
  331. local _t = 1-t
  332. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  333. end
  334.  
  335. function QuaternionFromCFrame(cf)
  336. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  337. local trace = m00 + m11 + m22
  338. if trace > 0 then
  339. local s = math.sqrt(1 + trace)
  340. local recip = 0.5/s
  341. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  342. else
  343. local i = 0
  344. if m11 > m00 then
  345. i = 1
  346. end
  347. if m22 > (i == 0 and m00 or m11) then
  348. i = 2
  349. end
  350. if i == 0 then
  351. local s = math.sqrt(m00-m11-m22+1)
  352. local recip = 0.5/s
  353. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  354. elseif i == 1 then
  355. local s = math.sqrt(m11-m22-m00+1)
  356. local recip = 0.5/s
  357. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  358. elseif i == 2 then
  359. local s = math.sqrt(m22-m00-m11+1)
  360. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  361. end
  362. end
  363. end
  364.  
  365. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  366. local xs, ys, zs = x + x, y + y, z + z
  367. local wx, wy, wz = w*xs, w*ys, w*zs
  368. local xx = x*xs
  369. local xy = x*ys
  370. local xz = x*zs
  371. local yy = y*ys
  372. local yz = y*zs
  373. local zz = z*zs
  374. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  375. end
  376.  
  377. function QuaternionSlerp(a, b, t)
  378. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  379. local startInterp, finishInterp;
  380. if cosTheta >= 0.0001 then
  381. if (1 - cosTheta) > 0.0001 then
  382. local theta = math.acos(cosTheta)
  383. local invSinTheta = 1/math.sin(theta)
  384. startInterp = math.sin((1-t)*theta)*invSinTheta
  385. finishInterp = math.sin(t*theta)*invSinTheta
  386. else
  387. startInterp = 1-t
  388. finishInterp = t
  389. end
  390. else
  391. if (1+cosTheta) > 0.0001 then
  392. local theta = math.acos(-cosTheta)
  393. local invSinTheta = 1/math.sin(theta)
  394. startInterp = math.sin((t-1)*theta)*invSinTheta
  395. finishInterp = math.sin(t*theta)*invSinTheta
  396. else
  397. startInterp = t-1
  398. finishInterp = t
  399. end
  400. end
  401. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  402. end
  403.  
  404. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  405. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  406. end
  407.  
  408. Damagefunc=function(Part,hit,minim,maxim,knockback,Type,Property,Delay,KnockbackType,decreaseblock)
  409. if hit.Parent==nil then
  410. return
  411. end
  412. local h=hit.Parent:FindFirstChild("Humanoid")
  413. for _,v in pairs(hit.Parent:children()) do
  414. if v:IsA("Humanoid") then
  415. h=v
  416. end
  417. end
  418. if hit.Parent.Parent:FindFirstChild("Torso")~=nil then
  419. h=hit.Parent.Parent:FindFirstChild("Humanoid")
  420. end
  421. if hit.Parent.className=="Hat" then
  422. hit=hit.Parent.Parent:findFirstChild("Head")
  423. end
  424. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  425. if hit.Parent:findFirstChild("DebounceHit")~=nil then if hit.Parent.DebounceHit.Value==true then return end end
  426. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  427. return
  428. end]]
  429. -- hs(hit,1.2)
  430. local c=Instance.new("ObjectValue")
  431. c.Name="creator"
  432. c.Value=game:service("Players").LocalPlayer
  433. c.Parent=h
  434. game:GetService("Debris"):AddItem(c,.5)
  435. local Damage=math.random(minim,maxim)
  436. -- h:TakeDamage(Damage)
  437. local blocked=false
  438. local block=hit.Parent:findFirstChild("Block")
  439. if block~=nil then
  440. print(block.className)
  441. if block.className=="NumberValue" then
  442. if block.Value>0 then
  443. blocked=true
  444. if decreaseblock==nil then
  445. block.Value=block.Value-1
  446. end
  447. end
  448. end
  449. if block.className=="IntValue" then
  450. if block.Value>0 then
  451. blocked=true
  452. if decreaseblock~=nil then
  453. block.Value=block.Value-1
  454. end
  455. end
  456. end
  457. end
  458. if blocked==false then
  459. -- h:TakeDamage(Damage)
  460. h.Health=h.Health-Damage
  461. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, Part.BrickColor.Color)
  462. else
  463. h.Health=h.Health-(Damage/2)
  464. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, BrickColor.new("Bright blue").Color)
  465. end
  466. if Type=="Knockdown" then
  467. local hum=hit.Parent.Humanoid
  468. hum.PlatformStand=true
  469. coroutine.resume(coroutine.create(function(HHumanoid)
  470. swait(1)
  471. HHumanoid.PlatformStand=false
  472. end),hum)
  473. local angle=(hit.Position-(Property.Position+Vector3.new(0,0,0))).unit
  474. --hit.CFrame=CFrame.new(hit.Position,Vector3.new(angle.x,hit.Position.y,angle.z))*CFrame.fromEulerAnglesXYZ(math.pi/4,0,0)
  475. local bodvol=Instance.new("BodyVelocity")
  476. bodvol.velocity=angle*knockback
  477. bodvol.P=5000
  478. bodvol.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  479. bodvol.Parent=hit
  480. local rl=Instance.new("BodyAngularVelocity")
  481. rl.P=3000
  482. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  483. rl.angularvelocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  484. rl.Parent=hit
  485. game:GetService("Debris"):AddItem(bodvol,.5)
  486. game:GetService("Debris"):AddItem(rl,.5)
  487. elseif Type=="Normal" then
  488. local vp=Instance.new("BodyVelocity")
  489. vp.P=500
  490. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  491. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  492. if KnockbackType==1 then
  493. vp.velocity=Property.CFrame.lookVector*knockback+Property.Velocity/1.05
  494. elseif KnockbackType==2 then
  495. vp.velocity=Property.CFrame.lookVector*knockback
  496. end
  497. if knockback>0 then
  498. vp.Parent=hit.Parent.Torso
  499. end
  500. game:GetService("Debris"):AddItem(vp,.5)
  501. elseif Type=="Up" then
  502. local bodyVelocity=Instance.new("BodyVelocity")
  503. bodyVelocity.velocity=vt(0,60,0)
  504. bodyVelocity.P=5000
  505. bodyVelocity.maxForce=Vector3.new(8e+003, 8e+003, 8e+003)
  506. bodyVelocity.Parent=hit
  507. game:GetService("Debris"):AddItem(bodyVelocity,1)
  508. local rl=Instance.new("BodyAngularVelocity")
  509. rl.P=3000
  510. rl.maxTorque=Vector3.new(500000,500000,500000)*50000000000000
  511. rl.angularvelocity=Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
  512. rl.Parent=hit
  513. game:GetService("Debris"):AddItem(rl,.5)
  514. elseif Type=="Snare" then
  515. local bp=Instance.new("BodyPosition")
  516. bp.P=2000
  517. bp.D=100
  518. bp.maxForce=Vector3.new(math.huge,math.huge,math.huge)
  519. bp.position=hit.Parent.Torso.Position
  520. bp.Parent=hit.Parent.Torso
  521. game:GetService("Debris"):AddItem(bp,1)
  522. elseif Type=="Target" then
  523. local Targetting = false
  524. if Targetting==false then
  525. ZTarget=hit.Parent.Torso
  526. coroutine.resume(coroutine.create(function(Part)
  527. so("http://www.roblox.com/asset/?id=15666462",Part,1,1.5)
  528. swait(5)
  529. so("http://www.roblox.com/asset/?id=15666462",Part,1,1.5)
  530. end),ZTarget)
  531. local TargHum=ZTarget.Parent:findFirstChild("Humanoid")
  532. local targetgui=Instance.new("BillboardGui")
  533. targetgui.Parent=ZTarget
  534. targetgui.Size=UDim2.new(10,100,10,100)
  535. local targ=Instance.new("ImageLabel")
  536. targ.Parent=targetgui
  537. targ.BackgroundTransparency=1
  538. targ.Image="rbxassetid://4834067"
  539. targ.Size=UDim2.new(1,0,1,0)
  540. cam.CameraType="Scriptable"
  541. cam.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position)
  542. local dir=Vector3.new(cam.CoordinateFrame.lookVector.x,0,cam.CoordinateFrame.lookVector.z)
  543. workspace.CurrentCamera.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position)
  544. Targetting=true
  545. RocketTarget=ZTarget
  546. for i=1,Property do
  547. --while Targetting==true and Humanoid.Health>0 and Character.Parent~=nil do
  548. if Humanoid.Health>0 and Character.Parent~=nil and TargHum.Health>0 and TargHum.Parent~=nil and Targetting==true then
  549. swait()
  550. end
  551. --workspace.CurrentCamera.CoordinateFrame=CFrame.new(Head.CFrame.p,Head.CFrame.p+rmdir*100)
  552. cam.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position)
  553. dir=Vector3.new(cam.CoordinateFrame.lookVector.x,0,cam.CoordinateFrame.lookVector.z)
  554. cam.CoordinateFrame=CFrame.new(Head.CFrame.p,ZTarget.Position)*cf(0,5,10)*euler(-0.3,0,0)
  555. end
  556. Targetting=false
  557. RocketTarget=nil
  558. targetgui.Parent=nil
  559. cam.CameraType="Custom"
  560. end
  561. end
  562. local debounce=Instance.new("BoolValue")
  563. debounce.Name="DebounceHit"
  564. debounce.Parent=hit.Parent
  565. debounce.Value=true
  566. game:GetService("Debris"):AddItem(debounce,Delay)
  567. c=Instance.new("ObjectValue")
  568. c.Name="creator"
  569. c.Value=Player
  570. c.Parent=h
  571. game:GetService("Debris"):AddItem(c,.5)
  572. end
  573. end
  574.  
  575.  
  576. function ShowDamage(Pos, Text, Time, Color)
  577. local Rate = (1 / 30)
  578. local Pos = (Pos or Vector3.new(0, 0, 0))
  579. local Text = (Text or "")
  580. local Time = (Time or 2)
  581. local Color = (Color or Color3.new(1, 0, 0))
  582. local EffectPart = part("Custom",workspace,"SmoothPlastic",0,1,BrickColor.new(Color),"Effect",vt(0,0,0))
  583. EffectPart.Anchored = true
  584. local BillboardGui = Instance.new("BillboardGui")
  585. BillboardGui.Size = UDim2.new(3, 0, 3, 0)
  586. BillboardGui.Adornee = EffectPart
  587. local TextLabel = Instance.new("TextLabel")
  588. TextLabel.BackgroundTransparency = 1
  589. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  590. TextLabel.Text = Text
  591. TextLabel.TextColor3 = Color
  592. TextLabel.TextScaled = true
  593. TextLabel.Font = Enum.Font.ArialBold
  594. TextLabel.Parent = BillboardGui
  595. BillboardGui.Parent = EffectPart
  596. game.Debris:AddItem(EffectPart, (Time + 0.1))
  597. EffectPart.Parent = game:GetService("Workspace")
  598. Delay(0, function()
  599. local Frames = (Time / Rate)
  600. for Frame = 1, Frames do
  601. wait(Rate)
  602. local Percent = (Frame / Frames)
  603. EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
  604. TextLabel.TextTransparency = Percent
  605. end
  606. if EffectPart and EffectPart.Parent then
  607. EffectPart:Destroy()
  608. end
  609. end)
  610. end
  611.  
  612. --example: local con = HitboxB.Touched:connect(function(hit) Damagefunc(Hitbox,hit,Dmg,Dmg,math.random(Knockback,Knockback),"Normal",RootPart,.2,1) end)
  613.  
  614. handle=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Cool yellow","Handle",Vector3.new(0.34799999, 1.85999942, 0.34799999))
  615. handleweld=weld(m,Character["Right Arm"],handle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0957183838, 0.289899826, 1.02796435, 0.999997258, -4.47034765e-008, -4.76837329e-007, 4.76837158e-007, -4.47016042e-008, -1.00000381, 5.96046448e-008, 0.999994218, -4.47017996e-008))
  616. mesh("CylinderMesh",handle,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  617. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(3.6771996, 0.348000109, 0.620599985))
  618. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0752487183, -3.95978737, -0.00869596004, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  619. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.34799999, 4.75599957, 0.620599985))
  620. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.000137329102, -3.495821, -0.00869381428, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  621. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Cool yellow","Part",Vector3.new(3.94400001, 0.579999983, 0.579999983))
  622. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0578308105, -3.95979309, 1.54972076e-005, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  623. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Cool yellow","Part",Vector3.new(0.579999983, 5.10399961, 0.579999983))
  624. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.000137329102, -3.43782616, 9.41753387e-006, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  625. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.811999977, 0.69599992, 0.812000036))
  626. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(6.86645508e-005, 1.89788628, 9.65595245e-006, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  627. mesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  628. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Cool yellow","Part",Vector3.new(0.579999983, 0.811999559, 0.579999983))
  629. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(5.34057617e-005, 1.25990677, 1.13248825e-005, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  630. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  631. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.811999977, 0.34799999, 0.812000036))
  632. Partweld=weld(m,handle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(5.7220459e-005, 1.60789871, 1.40666962e-005, 0.999994516, 9.53674999e-007, 1.4901282e-008, 9.53674999e-007, 1.00000763, 6.53699317e-013, 1.4901282e-008, 6.50146603e-013, 0.999988437))
  633. mesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  634.  
  635. function attackone()
  636. attack = true
  637. for i = 1,10 do
  638. so("rbxassetid://270657517",workspace,1,1)
  639. end
  640. for i = 1,40 do
  641. swait()
  642. for i = 0,1,0.2 do
  643. swait()
  644. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(-30),math.rad(0),math.rad(0)),.3)
  645. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-30),math.rad(0),math.rad(0)),.3)
  646. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(20)), 0.3)
  647. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(-50)), 0.3)
  648. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3)
  649. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3)
  650. end
  651. for i = 0,1,0.2 do
  652. swait()
  653. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  654. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  655. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(-20)), 0.3)
  656. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-20)), 0.3)
  657. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(-20)),.3)
  658. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(-20)),.3)
  659. end
  660. for i = 0,1,0.2 do
  661. swait()
  662. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(-30),math.rad(0),math.rad(0)),.3)
  663. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-30),math.rad(0),math.rad(0)),.3)
  664. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(20)), 0.3)
  665. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(30), math.rad(0), math.rad(-50)), 0.3)
  666. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3)
  667. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(20))*angles(math.rad(-5),math.rad(0),math.rad(0)),.3)
  668. end
  669. for i = 0,1,0.2 do
  670. swait()
  671. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  672. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(10),math.rad(0),math.rad(0)),.3)
  673. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(20)), 0.3)
  674. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-20)), 0.3)
  675. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(-20)),.3)
  676. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(-20)),.3)
  677. end
  678. end
  679. attack = false
  680. end
  681.  
  682. mouse.Button1Down:connect(function()
  683. if attack == false and attacktype == 1 then
  684. attacktype = 1
  685. attackone()
  686. end
  687. end)
  688.  
  689. mouse.KeyDown:connect(function(k)
  690. k=k:lower()
  691. if attack == false and k == '' then
  692.  
  693. end
  694. end)
  695.  
  696. local sine = 0
  697. local change = 1
  698. local val = 0
  699.  
  700. while true do
  701. swait()
  702. sine = sine + change
  703. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  704. local velderp=RootPart.Velocity.y
  705. hitfloor,posfloor=rayCast(RootPart.Position,(CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector,4,Character)
  706. if equipped==true or equipped==false then
  707. if attack==false then
  708. idle=idle+1
  709. else
  710. idle=0
  711. end
  712. if idle>=500 then
  713. if attack==false then
  714. end
  715. end
  716. if RootPart.Velocity.y > 1 and hitfloor==nil then
  717. Anim="Jump"
  718. if attack==false then
  719. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  720. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  721. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3)
  722. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  723. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3)
  724. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  725. end
  726. elseif RootPart.Velocity.y < -1 and hitfloor==nil then
  727. Anim="Fall"
  728. if attack==false then
  729. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  730. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  731. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3)
  732. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  733. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3)
  734. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  735. end
  736. elseif torvel<1 and hitfloor~=nil then
  737. Anim="Idle"
  738. if attack==false then
  739. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  740. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  741. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3)
  742. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  743. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3)
  744. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  745. end
  746. elseif torvel>2 and hitfloor~=nil then
  747. Anim="Walk"
  748. if attack==false then
  749. change=3
  750. RootJoint.C0 = clerp(RootJoint.C0,RootCF*cf(0,0,0)* angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  751. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.3)
  752. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(0)), 0.3)
  753. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), 0.3)
  754. RH.C0=clerp(RH.C0,cf(1,-1,0)*angles(math.rad(0),math.rad(90),math.rad(0)),.3)
  755. LH.C0=clerp(LH.C0,cf(-1,-1,0)*angles(math.rad(0),math.rad(-90),math.rad(0)),.3)
  756. end
  757. end
  758. end
  759. if #Effects>0 then
  760. for e=1,#Effects do
  761. if Effects[e]~=nil then
  762. local Thing=Effects[e]
  763. if Thing~=nil then
  764. local Part=Thing[1]
  765. local Mode=Thing[2]
  766. local Delay=Thing[3]
  767. local IncX=Thing[4]
  768. local IncY=Thing[5]
  769. local IncZ=Thing[6]
  770. if Thing[1].Transparency<=1 then
  771. if Thing[2]=="Block1" then
  772. Thing[1].CFrame=Thing[1].CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  773. Mesh=Thing[1].Mesh
  774. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  775. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  776. elseif Thing[2]=="Cylinder" then
  777. Mesh=Thing[1].Mesh
  778. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  779. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  780. elseif Thing[2]=="Blood" then
  781. Mesh=Thing[7]
  782. Thing[1].CFrame=Thing[1].CFrame*cf(0,.5,0)
  783. Mesh.Scale=Mesh.Scale+vt(Thing[4],Thing[5],Thing[6])
  784. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  785. elseif Thing[2]=="Elec" then
  786. Mesh=Thing[1].Mesh
  787. Mesh.Scale=Mesh.Scale+vt(Thing[7],Thing[8],Thing[9])
  788. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  789. elseif Thing[2]=="Disappear" then
  790. Thing[1].Transparency=Thing[1].Transparency+Thing[3]
  791. end
  792. else
  793. Part.Parent=nil
  794. table.remove(Effects,e)
  795. end
  796. end
  797. end
  798. end
  799. end
  800. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement