Advertisement
lafur

Untitled

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