Advertisement
Guest User

Untitled

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