Advertisement
samuelrichter66

HEEHEE

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