mrlolz88

Untitled

Jul 29th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.41 KB | None | 0 0
  1. loadstring(_G[" rmdx "])()
  2. Player=game:GetService("Players").LocalPlayer
  3. Char=Player.Character
  4. Backpack=Player.Backpack
  5. PlayerGui=Player.PlayerGui
  6. Torso=Char.Torso
  7. Head=Char.Head
  8. Hum=Char.Humanoid
  9. Cam=workspace.CurrentCamera
  10. Tn="Guardian Fighter"
  11.  
  12. pcall(function() Backpack[Tn]:Remove() end)
  13. pcall(function() Cam[Tn]:Remove() end)
  14. pcall(function() thesuit=Char[''] end)
  15. pcall(function() thesuit[Tn]:Remove() end)
  16. pcall(function() PlayerGui[Tn]:Remove() end)
  17. pcall(function() Char.Block:Remove() end)
  18. pcall(function() Char.HumanoidJointPart['BodyGyro']:Remove() end)
  19.  
  20. CModel=qi{'Model',Cam,Name=Tn}
  21. Tool=qi{'HopperBin',Player.Backpack,Name=Tn}
  22. Suit=qi{'Model',Char,Name=''}
  23. Weapon=qi{'Model',Suit,Name=Tn}
  24. Gui=qi{'ScreenGui',PlayerGui,Name=Tn}
  25. Block=qi{'NumberValue',Char,Name='Block'}
  26.  
  27. equip="unequipped"
  28. anim=""
  29. keys={}
  30. fmouse=nil
  31. running=false
  32. Combo=0
  33.  
  34. ids = {}
  35. ids.Slash = 10209645
  36. ids.Slash2 = 46760716
  37. ids.Slash3 = 10209640
  38. ids.ShieldBash = 2692806
  39. ids.Spike = 1033714
  40. ids.Hit = 10209590
  41. ids.Shine = 48965808
  42. ids.Ring = 3270017
  43. ids.BladeTip = 9756362
  44. ids.Block = 'rbxasset://sounds\\metal.ogg'
  45.  
  46. for i,v in pairs(ids) do
  47. if type(v)=='number' then
  48. ids[i]='http://www.roblox.com/asset/?id='..v
  49. end
  50. game:GetService("ContentProvider"):Preload(ids[i])
  51. end
  52.  
  53. Limbs={LS=Torso:findFirstChild'Left Shoulder',RS=Torso:findFirstChild'Right Shoulder',LH=Torso:findFirstChild'Left Hip',RH=Torso:findFirstChild'Right Hip'}
  54. if _G.Limbz then
  55. Limbs.LS=Limbs.LS or _G.Limbz.LS
  56. Limbs.RS=Limbs.RS or _G.Limbz.RS
  57. Limbs.LH=Limbs.LH or _G.Limbz.LH
  58. Limbs.RH=Limbs.RH or _G.Limbz.RH
  59. end
  60. _G.Limbz=Limbs
  61. Torso.Neck.C0=cn(0,1.5,0) Torso.Neck.C1=cn(0,0,0)
  62. LS,RS,LH,RH=Limbs.LS,Limbs.RS,Limbs.LH,Limbs.RH
  63. LA,RA,LL,RL=Char['Left Arm'],Char['Right Arm'],Char['Left Leg'],Char['Right Leg']
  64. LS.Part0,RS.Part0,LH.Part0,RH.Part0=Torso,Torso,Torso,Torso
  65. LS.Part1,RS.Part1,LH.Part1,RH.Part1=LA,RA,LL,RL
  66.  
  67. pcall(function() thesuit:Remove() end)
  68.  
  69. fTorso=Char.HumanoidRootPart tw=fTorso.RootJoint hw=Torso.Neck c2(tw,1,3,0,0,0,90,180,0)
  70. la=qi{'Weld',Torso,Part0=Torso,C0=cn(-1.5,0.5,0),C1=cn(0,0.5,0)} ra=qi{'Weld',Torso,Part0=Torso,C0=cn(1.5,0.5,0),C1=cn(0,0.5,0)}
  71. ll=qi{'Weld',Torso,Part0=Torso,C0=cn(-0.5,-1,0),C1=cn(0,1,0)} rl=qi{'Weld',Torso,Part0=Torso,C0=cn(0.5,-1,0),C1=cn(0,1,0)}
  72.  
  73. Arms = function(on)
  74. if on then
  75. LS.Part1=nil RS.Part1=nil
  76. la.Part0=Torso ra.Part0=Torso
  77. la.Part1=LA ra.Part1=RA
  78. la.C0,la.C1=cn(-1.5,0.5,0),cn(0,0.5,0)
  79. ra.C0,ra.C1=cn(1.5,0.5,0),cn(0,0.5,0)
  80. else
  81. LS.Parent,RS.Parent=Torso,Torso
  82. LS.Part0=Torso
  83. RS.Part0=Torso
  84. LS.Part1=LA
  85. RS.Part1=RA
  86. la.Part1=nil ra.Part1=nil
  87. end
  88. end
  89.  
  90. Legs = function(on)
  91. if on then
  92. LH.Part1=nil RH.Part1=nil
  93. ll.Part0=Torso rl.Part0=Torso
  94. ll.Part1=LL rl.Part1=RL
  95. ll.C0,ll.C1=cn(-0.5,-1,0),cn(0,1,0)
  96. rl.C0,rl.C1=cn(0.5,-1,0),cn(0,1,0)
  97. else
  98. LH.Parent,RH.Parent=Torso,Torso
  99. LH.Part0=Torso
  100. RH.Part0=Torso
  101. LH.Part1=LL
  102. RH.Part1=RL
  103. ll.Part1=nil rl.Part1=nil
  104. end
  105. end
  106.  
  107. function Design(c)
  108. ha=pa(Weapon,"1","Block",0.3,1,0.3,false,false,0,0,c[1]) haw=weld(ha,Torso,ha,-1,-1,0,0,rd(90),rd(110)) qi{"CylinderMesh",ha}
  109. sp=pa(Weapon,"1","Block",0.4,0.4,0.4,false,false,0,0,c[1]) weld(sp,ha,sp,0,-0.5,0,0,0,0) qi{"SpecialMesh",sp,MeshType="Sphere"}
  110. hap=pa(Weapon,"1","Block",0.5,0,0.3,false,false,0,0,c[1]) weld(hap,ha,hap,0,0.6,0,0,0,0)
  111. sp=pa(Weapon,"1","Block",1,1,1,false,false,0,0,c[1]) weld(sp,hap,sp,0.25+0.125,0,-0.075,0,0,rd(-90)) qi{"SpecialMesh",sp,MeshType="Wedge",Scale=v3(0.2,0.25,0.15)}
  112. sp=pa(Weapon,"1","Block",1,1,1,false,false,0,0,c[1]) weld(sp,hap,sp,-0.25-0.125,0,-0.075,0,0,rd(90)) qi{"SpecialMesh",sp,MeshType="Wedge",Scale=v3(0.2,0.25,0.15)}
  113. sp=pa(Weapon,"1","Block",1,1,1,false,false,0,0,c[1]) weld(sp,hap,sp,-0.25-0.125,0,0.075,0,rd(-180),rd(-90)) qi{"SpecialMesh",sp,MeshType="Wedge",Scale=v3(0.2,0.25,0.15)}
  114. sp=pa(Weapon,"1","Block",1,1,1,false,false,0,0,c[1]) weld(sp,hap,sp,0.25+0.125,0,0.075,0,rd(180),rd(90)) qi{"SpecialMesh",sp,MeshType="Wedge",Scale=v3(0.2,0.25,0.15)}
  115. bp=pa(Weapon,"1","Block",2.5,0.3,1,false,false,0,0,c[2]) weld(bp,hap,bp,-0.15,bp.Size.X/2,-0.05,0,0,rd(90)) qi{"SpecialMesh",bp,MeshType="Wedge",Scale=v3(1,1,0.1)}
  116. bp=pa(Weapon,"1","Block",2.5,0.3,1,false,false,0,0,c[2]) weld(bp,hap,bp,0.15,bp.Size.X/2,-0.05,0,0,rd(-90)) qi{"SpecialMesh",bp,MeshType="Wedge",Scale=v3(1,1,0.1)}
  117. bp=pa(Weapon,"1","Block",2.5,0.3,1,false,false,0,0,c[2]) weld(bp,hap,bp,-0.15,bp.Size.X/2,0.05,0,rd(-180),rd(-90)) qi{"SpecialMesh",bp,MeshType="Wedge",Scale=v3(1,1,0.1)}
  118. bp=pa(Weapon,"1","Block",2.5,0.3,1,false,false,0,0,c[2]) weld(bp,hap,bp,0.15,bp.Size.X/2,0.05,0,rd(180),rd(90)) qi{"SpecialMesh",bp,MeshType="Wedge",Scale=v3(1,1,0.1)}
  119. bp=pa(Weapon,"1","Block",1,2,1,false,false,0,0,c[2]) weld(bp,hap,bp,0,2.5,0,0,0,0) qi{"SpecialMesh",bp,MeshId=ids.BladeTip,Scale=v3(0.41,1,0.1375)}
  120.  
  121. ha2=pa(Weapon,"2","Block",1.1,0.4,1.1,false,false,0,0,c[3]) haw2=weld(ha2,LA,ha2,0,-0.2,0,0,0,0)
  122. mshp=pa(Weapon,"2","Block",0.2,1.25,4,false,false,0,0,c[1]) weld(mshp,ha2,mshp,-0.55,0.2,0.25,0,0,0)
  123. h1=pa(Weapon,"2","Block",0,0,0,false,false,1,0) weld(h1,mshp,h1,-0.1,1.25/2,0,0,0,rd(-20))
  124. h2=pa(Weapon,"2","Block",0,0,0,false,false,1,0) weld(h2,mshp,h2,-0.1,-1.25/2,0,0,0,rd(20))
  125. shp=pa(Weapon,"2","Block",0.2,0.75,4,false,false,0,0,c[1]) weld(shp,h1,shp,0.1,0.75/2,0,0,0,0)
  126. shp=pa(Weapon,"2","Block",0.2,0.75,4,false,false,0,0,c[1]) weld(shp,h2,shp,0.1,-0.75/2,0,0,0,0)
  127. for i,v in pairs(Weapon:GetChildren()) do v.CanCollide=false end
  128. end
  129.  
  130. Design({"Really black","Gold","Really black"})
  131. Arms(false)
  132. Legs(false)
  133.  
  134. Dealt={15,24}
  135. Dealt2={30,37}
  136. BBD,BBT=0,{}
  137. BBD2,BBT2=0,{}
  138. CritChance = 15
  139. CriticalSeverity=2.25
  140.  
  141. SwordHit=function(hit)
  142. local Hum=GetHum(hit)
  143. if not Hum or BBD==0 or BBT[Hum.Parent] then return end
  144. BBT[Hum.Parent]=1
  145. if rn(1,100)<=CritChance then
  146. Dmg(Hum,rn(Dealt[1],Dealt[2])*CriticalSeverity,true)
  147. else
  148. Dmg(Hum,rn(Dealt[1],Dealt[2]),false)
  149. end
  150. local HMT=Hum.Parent:findFirstChild'Torso'
  151. if BBD==2 and HMT then AddBV(10,cn(Torso.Position,HMT.Position),HMT,0.15) end
  152. so(ids.Hit,HMT,1,1)
  153. wait(0.4)
  154. BBT[Hum.Parent]=nil
  155. end
  156.  
  157. ShieldHit=function(hit)
  158. local Hum=GetHum(hit)
  159. if not Hum or BBD2==0 or BBT2[Hum.Parent] then return end
  160. BBT2[Hum.Parent]=1
  161. if rn(1,100)<=CritChance/2 then
  162. Dmg(Hum,rn(Dealt2[1],Dealt2[2])*CriticalSeverity,true)
  163. else
  164. Dmg(Hum,rn(Dealt2[1],Dealt2[2]),false)
  165. end
  166. local HMT=Hum.Parent:findFirstChild'Torso'
  167. if BBD2==2 and HMT then
  168. Hum.PlatformStand=true
  169. q(function()
  170. wait(1)
  171. Hum.PlatformStand=false
  172. end)
  173. AddBV(50,cn(Torso.Position,HMT.Position),HMT,0.15)
  174. end
  175. so(ids.ShieldBash,HMT,1,0.35)
  176. wait(0.4)
  177. BBT2[Hum.Parent]=nil
  178. end
  179.  
  180. for i,v in pairs(Weapon:GetChildren()) do if v.Name=="1" then v.Touched:connect(SwordHit) end end
  181. for i,v in pairs(Weapon:GetChildren()) do if v.Name=="2" then v.Touched:connect(ShieldHit) end end
  182.  
  183. function Trail(Loops,Part,Time,Color,Thickness,Offset)
  184. q(function()
  185. local oldpos=(Part.CFrame *Offset).p
  186. local lopz2=0
  187. local function loltr()
  188. local obp=(Part.CFrame *Offset).p
  189. lopz2=lopz2 + 1
  190. local mag=(oldpos - obp).magnitude
  191. local tr=pa(Part,"trail","Block",0,0,0,false,true,0,0,Color)
  192. tr.CanCollide=false
  193. tr.CFrame=cn(oldpos,obp)
  194. tr.CFrame=tr.CFrame + tr.CFrame.lookVector*(mag/2)
  195. local trm=qi{'CylinderMesh',tr,Scale=v3(5*Thickness,mag*5,5*Thickness)}
  196. q(function()
  197. for i=5*Thickness,0,-5*Thickness/10 do
  198. trm.Scale=v3(i,mag*5,i)
  199. w()
  200. end
  201. tr:Remove''
  202. end)
  203. tr.CFrame=tr.CFrame*ca(rd(90),0,0)
  204. oldpos=obp
  205. end
  206. repeat
  207. loltr()
  208. wait(Time)
  209. until lopz2 == Loops
  210. loltr()
  211. end)
  212. end
  213.  
  214. function Stance(speed)
  215. c2(ra,speed,3,1.5,0.5,0,-18,0,-18)
  216. c2(la,speed,3,-1.5,0.5,0,10,0,10)
  217. c2(ll,speed,3,-0.5,-1,0,0,0,0)
  218. c2(rl,speed,3,0.5,-1,0,0,0,0)
  219. c2(hw,speed,3,0,1.5,0,0,0,0)
  220. c2(tw,speed,3,0,0,0,90,180,0)
  221. c2(hw,speed,3,0,1.5,0,0,0,0)
  222. Ani(haw,0,-1,0,-90,90,0,0,speed/1.5,1)
  223. end
  224.  
  225. function Reset(speed)
  226. c2(ra,speed,3,1.5,0.5,0,0,0,0)
  227. c2(la,speed,3,-1.5,0.5,0,0,0,0)
  228. c2(ll,speed,3,-0.5,-1,0,0,0,0)
  229. c2(rl,speed,3,0.5,-1,0,0,0,0)
  230. c2(hw,speed,3,0,1.5,0,0,0,0)
  231. c2(tw,speed,3,0,0,0,90,180,0)
  232. c2(hw,speed,3,0,1.5,0,0,0,0)
  233. Ani(haw,-1,-1,0,0,90,110,0,speed/1.5,1)
  234. end
  235.  
  236. function Combo1()
  237. Combo=0.5
  238. anim="Melee"
  239. c2(ra,0.12,3,1.5,0.7,0,-135,0,60)
  240. c1(hw,0.12,3,0,1.5,0,-25,22.5,0)
  241. anim=""
  242. Combo=1
  243. end
  244.  
  245. function Combo2()
  246. Combo=1.5
  247. anim="Melee"
  248. so(ids.Slash3,bp,1,1)
  249. Trail(8,bp,0,"Gold",0.1,cn(0,0.7,0))
  250. BBD=2
  251. c2(ra,0.25,3,0.5,0.2,-0.5,0,-45+22.5,30)
  252. c1(hw,0.25,3,0,1.5,0,10,-30,0)
  253. BBD=0
  254. anim=""
  255. Combo=2
  256. end
  257.  
  258. function Combo3()
  259. Combo=2.5
  260. anim="Melee"
  261. c2(hw,0.12,3,0,1.5,0,0,-50,0)
  262. c2(ra,0.12,3,1,0.5,-0.5,-120,0,-90)
  263. c1(la,0.12,3,-1.5,0.5,0,45,0,45)
  264. anim=""
  265. Combo=3
  266. end
  267.  
  268. function Combo4()
  269. Combo=3.5
  270. anim="Melee"
  271. so(ids.Slash3,bp,1,1)
  272. Trail(8,bp,0,"Gold",0.1,cn(0,0.7,0))
  273. BBD=2
  274. c2(hw,0.25,3,0,1.5,0,0,60,0)
  275. c1(ra,0.25,3,1.25,0.5,0.3,35,0,-90)
  276. BBD=0
  277. anim=""
  278. Combo=4
  279. end
  280.  
  281. function Combo5()
  282. Combo=4.5
  283. anim="Melee"
  284. c2(tw,0.12,3,0,0,0,90,180,15)
  285. c2(la,0.12,3,-0.5,0.5,-1,-90,90-15,0)
  286. c2(hw,0.12,3,0,1.5,0,0,-15,0)
  287. c1(ra,0.12,3,1.5,0.5,0,35,0,-35)
  288. Block.Value=4
  289. anim=""
  290. Combo=5
  291. end
  292.  
  293. function Combo6()
  294. Combo=5.5
  295. anim="Melee"
  296. c2(la,0.12,3,-0.45,0.5,-0.9,-90,100-15,0)
  297. c2(tw,0.12,3,0,0,0,90,180,25)
  298. c1(hw,0.12,3,0,1.5,0,0,-20,0)
  299. anim=""
  300. Combo=6
  301. end
  302.  
  303. function Combo7()
  304. Combo=6.5
  305. anim="Melee"
  306. so(ids.Slash,mshp,1,0.5)
  307. BBD2=2
  308. Trail(8,mshp,0,"Gold",1.5,cn(0,0,0))
  309. Block.Value=0
  310. c2(la,0.25,3,-1.25,0.5,0.25,-90,-120,0)
  311. c2(tw,0.25,3,0,0,0,90,180,-50)
  312. c1(hw,0.25,3,0,1.5,0,0,-35,0)
  313. BBD2=0
  314. Combo=7
  315. anim=""
  316. end
  317.  
  318. function Break()
  319. Combo=-0.5
  320. Block.Value=0
  321. Stance(0.1)
  322. anim=""
  323. Combo=0
  324. end
  325.  
  326. function Button1Down()
  327. if equip=="equipped" and anim=="" then
  328. if Combo==0 then
  329. Combo1()
  330. q(function()
  331. wait(1)
  332. if Combo==1 then
  333. Break()
  334. end
  335. end)
  336. elseif Combo==1 then
  337. Combo2()
  338. q(function()
  339. wait(1)
  340. if Combo==2 then
  341. Break()
  342. end
  343. end)
  344. elseif Combo==2 then
  345. Combo3()
  346. q(function()
  347. wait(1)
  348. if Combo==3 then
  349. Break()
  350. end
  351. end)
  352. elseif Combo==3 then
  353. Combo4()
  354. q(function()
  355. wait(1)
  356. if Combo==4 then
  357. Break()
  358. end
  359. end)
  360. elseif Combo==4 then
  361. Combo5()
  362. q(function()
  363. wait(1)
  364. if Combo==5 then
  365. Break()
  366. end
  367. end)
  368. elseif Combo==5 then
  369. Combo6()
  370. q(function()
  371. wait(1)
  372. if Combo==6 then
  373. Break()
  374. end
  375. end)
  376. elseif Combo==6 then
  377. Combo7()
  378. q(function()
  379. wait(1)
  380. if Combo==7 then
  381. Break()
  382. end
  383. end)
  384. end
  385. end
  386. if equip=="equipped" and anim=="Block" and keys["f"]==true then
  387. anim="ShieldBash"
  388. c2(la,0.12,3,-0.45,0.5,-0.9,-90,100,0)
  389. c2(tw,0.12,3,0,0,0,90,180,15)
  390. c1(hw,0.12,3,0,1.5,0,0,5,0)
  391. so(ids.Slash,mshp,1,0.5)
  392. wait(0.2)
  393. Hum.WalkSpeed=16
  394. BBD2=2
  395. Trail(8,mshp,0,"Gold",1.5,cn(0,0,0))
  396. Block.Value=0
  397. c2(la,0.25,3,-1.25,0.5,0.25,-90,-120,0)
  398. c2(tw,0.25,3,0,0,0,90,180,-50)
  399. c1(hw,0.25,3,0,1.5,0,0,-35,0)
  400. BBD2=0
  401. wait(0.4)
  402. Stance(0.1)
  403. anim=""
  404. end
  405. end
  406.  
  407. function KeyDown(key)
  408. key=key:lower()
  409. keys[key]=true
  410. if key == "f" then
  411. if anim=="" and equip=="equipped" and Combo==0 then
  412. anim="Blocking" Block.Value=4 Hum.WalkSpeed=8
  413. c2(la,0.12,3,-0.5,0.5,-1,-90,90,0)
  414. c1(ra,0.12,3,1.5,0.5,0,35,0,-35)
  415. anim="Block"
  416. repeat wait() until Block.Value<=0
  417. if anim=="Block" then
  418. Block.Value=0
  419. anim="Unblocking"
  420. Hum.WalkSpeed=16
  421. Stance(0.05)
  422. anim=""
  423. end
  424. end
  425. end
  426. end
  427.  
  428. function KeyUp(key)
  429. key=key:lower()
  430. keys[key]=false
  431. if key=="f" and equip=="equipped" and anim=="Block" then
  432. anim="Unblocking"
  433. Block.Value=0
  434. Hum.WalkSpeed=16
  435. Stance(0.2)
  436. anim=""
  437. end
  438. end
  439.  
  440. Tool.Selected:connect(function(m)
  441. fmouse=m
  442. if equip=="unequipped" and anim=="" and Combo==0 then
  443. anim="equipping"
  444. Arms(true)
  445. c2(hw,0.1,3,0,1.5,0,15,-15,0)
  446. c1(ra,0.1,3,1.5/3,0.5/3,-0.7,0,-180,60)
  447. c2(ra,0.1,3,1.5/3,0.5/3,-0.7,60,-180,60)
  448. Ani(haw,-1,-0.25,-2.5,0,90,110,0,0.05,1)
  449. local ofs = RA.CFrame:toObjectSpace(ha.CFrame)
  450. haw.Part0=RA haw.C0=ofs haw.C1=cn(0,0,0) rAni(haw)
  451. Stance(0.1)
  452. anim=""
  453. equip="equipped"
  454. end
  455. m.Button1Down:connect(Button1Down)
  456. m.KeyDown:connect(KeyDown)
  457. m.KeyUp:connect(KeyUp)
  458. end)
  459.  
  460. Tool.Deselected:connect(function()
  461. fmouse=nil
  462. if equip=="equipped" and anim=="" and Combo==0 then
  463. anim="unequipping"
  464. c2(hw,0.1,3,0,1.5,0,15,-15,0)
  465. c1(ra,0.1,3,1.5/3,0.5/3,-0.7,60,-180,60)
  466. c2(ra,0.1,3,1.5/3,0.5/3,-0.7,0,-180,60)
  467. local ofs = Torso.CFrame:toObjectSpace(ha.CFrame)
  468. haw.Part0=Torso haw.C0=ofs haw.C1=cn(0,0,0) rAni(haw)
  469. Reset(0.1)
  470. Arms(false)
  471. Legs(false)
  472. anim=""
  473. equip="unequipped"
  474. end
  475. end)
  476.  
  477. Gyro=qi{"BodyGyro",fTorso,D=50,P=1500}
  478. game:GetService("RunService").Stepped:connect(function()
  479. if fmouse ~= nil then
  480. Gyro.maxTorque=v3(1/0,1/0,1/0)
  481. Gyro.cframe = cn(fTorso.Position,v3(Cam.CoordinateFrame.p.x,fTorso.Position.y,Cam.CoordinateFrame.p.z))*ca(0,rd(180),0)
  482. else
  483. Gyro.maxTorque = v3(0,0,0)
  484. end
  485. end)
  486.  
  487. Hum.Running:connect(function(spd)
  488. if spd>0 then
  489. running=true
  490. else
  491. running=false
  492. end
  493. end)
  494. wait()
  495.  
  496. local player = game.Players.LocalPlayer
  497. local m = player:GetMouse()
  498.  
  499. local runService = game:GetService("RunService")
  500.  
  501. local dp = Vector3.new()
  502. local dcf = CFrame.new()
  503.  
  504. local shrink
  505. local magiccam = true
  506. local camconnect
  507.  
  508. local oldPos = Vector3.new()
  509. local oldx = Vector3.new()
  510. local oldy = Vector3.new()
  511. local oldz = Vector3.new()
  512.  
  513. local helpergui = Instance.new("ScreenGui", player.PlayerGui)
  514. local camRot = Vector2.new()
  515. local camDist = 10
  516.  
  517. function camera()
  518. if magiccam then
  519. local ax = CFrame.Angles(camRot.x, 0, 0)
  520. local ay = CFrame.Angles(0, camRot.y, 0)
  521. local a = CFrame.Angles(-(m.Y / helpergui.AbsoluteSize.y-0.5), -(m.X / helpergui.AbsoluteSize.x-0.5), 0) * ay * ax
  522. local sx, sy, sz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = (player.Character.Head.CFrame * a):components()
  523. local x = Vector3.new(m00, m10, m20)
  524. local y = Vector3.new(m01, m11, m21)
  525. local z = Vector3.new(m02, m12, m22)
  526. local p = Vector3.new(sx, sy, sz)
  527. local lv = (player.Character.Head.CFrame * ay * ax).lookVector
  528. p = p - lv * camDist
  529. p = p:Lerp(oldPos, 0.8)
  530. x = x:Lerp(oldx, 0.8)
  531. y = y:Lerp(oldy, 0.8)
  532. z = z:Lerp(oldz, 0.8)
  533. x = x / x.magnitude
  534. y = y / y.magnitude
  535. z = z / z.magnitude
  536. oldx = x
  537. oldy = y
  538. oldz = z
  539. oldPos = p
  540. game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(p.x, p.y, p.z, x.x, y.x, z.x,
  541. x.y, y.y, z.y,
  542. x.z, y.z, z.z)
  543. end
  544. end
  545.  
  546. local mPos = Vector2.new()
  547. local mb2d = false
  548. m.Button2Down:connect(function ()
  549. mb2d = true
  550. mPos = Vector2.new(m.X, m.Y)
  551. while mb2d do
  552. camRot = Vector2.new(-((m.Y-mPos.y) / helpergui.AbsoluteSize.y) * math.pi * 1.5, -((m.X-mPos.x) / helpergui.AbsoluteSize.x) * math.pi * 2)
  553. wait()
  554. end
  555. end)
  556.  
  557. m.Button2Up:connect(function ()
  558. camRot = Vector2.new()
  559. mb2d = false
  560. end)
  561.  
  562. --[[m.WheelForward:connect(function ()
  563. camDist = math.max(camDist - 1, 3)
  564. end)
  565.  
  566. m.WheelBackward:connect(function ()
  567. camDist = math.min(camDist + 1, 50)
  568. end)
  569.  
  570. player.Character.Humanoid.Died:connect(function ()
  571. magiccam = false
  572. game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
  573. end)
  574.  
  575. runService.RenderStepped:connect(camera)
  576.  
  577. game.Workspace.CurrentCamera.CameraType = "Scriptable"]]
Add Comment
Please, Sign In to add comment