Advertisement
megaluxe

jesus

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