Advertisement
Guest User

Untitled

a guest
May 25th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.26 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145. --3D Manuever Gear Script --
  146. -- Based off of Attack on titan c; --
  147. -- Local Sc
  148. -- Made by spideybears [NOT THE SCRIPT] --
  149. -- ript --
  150. debounce = false
  151. v3 = Vector3.new
  152. cn = CFrame.new
  153. ca2 = CFrame.Angles
  154. mf = math.floor
  155. mran = math.random
  156. mrad = math.rad
  157. mdeg = math.deg
  158. ca = function(x,y,z) return ca2(mrad(x),mrad(y),mrad(z)) end
  159. v32=function(x,y,z) return v3(mdeg(x),mdeg(y),mdeg(z)) end
  160. mran2 = function(a,b) return mran(a*1000,b*1000)/1000 end
  161. ud=UDim2.new
  162. bn = BrickColor.new
  163. c3 = Color3.new
  164. nov3=v3(0,0,0)
  165. maxv3=v3(1,1,1)/0
  166. -----
  167. Player = game:service'Players'.LocalPlayer
  168. Char = Player.Character
  169. Torso = Char.Torso
  170. Head = Char.Head
  171. Humanoid = Char.Humanoid
  172. Root=Char.HumanoidRootPart.RootJoint
  173.  
  174. LA=Char['Left Arm']
  175. RA=Char['Right Arm']
  176. LL=Char['Left Leg']
  177. RL=Char['Right Leg']
  178. LAM=Torso:findFirstChild'Left Shoulder' or _G.LAM
  179. RAM=Torso:findFirstChild'Right Shoulder' or _G.RAM
  180. LLM=Torso:findFirstChild'Left Hip' or _G.LLM
  181. RLM=Torso:findFirstChild'Right Hip' or _G.RLM
  182. Neck=Torso.Neck
  183. Neck.C0=cn(0,1.5,0)
  184. Neck.C1=cn(0,0,0)
  185. _G.LAM=LAM _G.RAM=RAM _G.LLM=LLM _G.RLM=RLM
  186.  
  187.  
  188. as,so={},{'metal','Block','Slash','Slash2','Hit','Kick'}
  189. as.corner='11294911'
  190. as.cone='1033714'
  191. as.ring="3270017"
  192. as.Chakram='47260990'
  193. as.ring2='18430887'
  194. as.blast='20329976'
  195. as.missile='10207677'
  196. as.fire='2693346'
  197. as.boom='3264793'
  198. as.slash='10209645'
  199. as.abscond='2767090'
  200. as.firelaser='13775494'
  201. as.diamond='9756362'
  202. as.metal='rbxasset://sounds\\unsheath.wav'
  203. as.Block = 'rbxasset://sounds\\metal.ogg'
  204. as.Slash = '10209645'
  205. as.Slash2 = '46760716'
  206. as.Hit='10209583'
  207. as.Kick='46153268'
  208. as.cast='2101137'
  209.  
  210.  
  211. for i,v in pairs(as) do
  212. if type(tonumber(v:sub(1,3)))=="number" then
  213. as[i]="http://www.roblox.com/asset/?id="..v
  214. end
  215. end
  216.  
  217. game:service"ControllerService":ClearAllChildren()
  218. Controls=Instance.new("HumanoidController",game:service"ControllerService")
  219.  
  220.  
  221. LastMade=nil
  222. iNew=function(tab)
  223. local v=Instance.new(tab[1])
  224. for Ind,Val in pairs(tab) do
  225. if Ind~=1 and Ind~=2 then
  226. v[Ind] = Val
  227. end
  228. end
  229. v.Parent=tab[2]==0 and LastMade or tab[2]
  230. LastMade=v
  231. return v
  232. end
  233. iPart=function(tab)
  234. local v=Instance.new(tab.type or 'Part')
  235. if tab.type~='CornerWedgePart' then v.formFactor='Custom' end
  236. v.TopSurface=0 v.BottomSurface=0
  237. if tab.sc then
  238. v.Size=v3(tab[2]*tab.sc,tab[3]*tab.sc,tab[4]*tab.sc)
  239. else
  240. v.Size=v3(tab[2],tab[3],tab[4])
  241. end
  242. if tab.co then v.BrickColor=bn(tab.co) end
  243. if tab.tr then v.Transparency=tab.tr end
  244. if tab.rf then v.Reflectance=tab.rf end
  245. v.CanCollide=false --if tab.can then v.CanCollide=tab.can end
  246. if tab.cf then v.CFrame=tab.cf end
  247. if tab.an then v.Anchored=tab.an end
  248. if tab.na then v.Name=tab.na end
  249. if tab.ma then v.Material=tab.ma end
  250. v.Parent=tab[1]
  251. v:BreakJoints()
  252. LastMade=v
  253. return v
  254. end
  255. ray = function(Pos, Dir,tab,length) -- ray cast
  256. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit *(length or 999)),tab)
  257. end
  258. function getoutline(x,z,i)
  259. return math.sqrt(x^2+z^2)+(i or 0.05),mdeg(math.atan2(x,z))
  260. end
  261. function v3a(cf)
  262. local x,y,z=cf:toEulerAnglesXYZ()
  263. return v3(mdeg(x),mdeg(y),mdeg(z))
  264. end
  265. function TweenV3(i, loops,origpos,nextpos,smooth)
  266. loops=math.floor(loops)
  267. smooth = smooth or 1
  268. local tox2,toy2,toz2 = 0,0,0
  269. local perc =smooth==1 and math.sin((math.pi/2)/loops*i) or i/loops
  270. tox2= origpos.x > nextpos.x and -math.abs(origpos.x - nextpos.x) *perc or math.abs(origpos.x - nextpos.x) *perc
  271. toy2= origpos.y > nextpos.y and -math.abs(origpos.y - nextpos.y) *perc or math.abs(origpos.y - nextpos.y) *perc
  272. toz2= origpos.z > nextpos.z and -math.abs(origpos.z - nextpos.z) *perc or math.abs(origpos.z - nextpos.z) *perc
  273. return v3(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)
  274. end
  275. function TweenCF(i, loops,origpos,nextpos,smooth)
  276. loops=math.floor(loops)
  277. smooth = smooth or 1
  278. local x0,y0,z0=origpos:toEulerAnglesXYZ()
  279. local x1,y1,z1=nextpos:toEulerAnglesXYZ()
  280. origangle=v32(x0,y0,z0)
  281. nextangle=v32(x1,y1,z1)
  282. local perc =smooth==1 and math.sin((math.pi/2)/loops*i) or i/loops
  283. local tox,toy,toz = 0,0,0
  284. tox = origangle.x > nextangle.x and -math.abs(origangle.x - nextangle.x) *perc or math.abs(origangle.x - nextangle.x) *perc
  285. toy = origangle.y > nextangle.y and -math.abs(origangle.y - nextangle.y) *perc or math.abs(origangle.y - nextangle.y) *perc
  286. toz = origangle.z > nextangle.z and -math.abs(origangle.z - nextangle.z) *perc or math.abs(origangle.z - nextangle.z) *perc
  287. local tox2,toy2,toz2 = 0,0,0
  288. tox2= origpos.x > nextpos.x and -math.abs(origpos.x - nextpos.x) *perc or math.abs(origpos.x - nextpos.x) *perc
  289. toy2= origpos.y > nextpos.y and -math.abs(origpos.y - nextpos.y) *perc or math.abs(origpos.y - nextpos.y) *perc
  290. toz2= origpos.z > nextpos.z and -math.abs(origpos.z - nextpos.z) *perc or math.abs(origpos.z - nextpos.z) *perc
  291. return cn(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*ca(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  292. end
  293. WeldLib={}
  294. function GetWeld(weld,CO)
  295. if not WeldLib[weld] then
  296. local x0,y0,z0=weld.C0:toEulerAnglesXYZ()
  297. local x1,y1,z1=weld.C1:toEulerAnglesXYZ()
  298. WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))}
  299. end
  300. return weld['C'..CO].p,WeldLib[weld][CO]
  301. end
  302. function ClearWeld(weld)
  303. if WeldLib[weld] then WeldLib[weld]=nil end
  304. end
  305. function SetWeld(weld,CO,i, loops, origpos,origangle, nextpos,nextangle,smooth)
  306. loops=math.floor(loops)
  307. smooth = smooth or 1
  308. if not WeldLib[weld] then
  309. local x0,y0,z0=weld.C0:toEulerAnglesXYZ()
  310. local x1,y1,z1=weld.C1:toEulerAnglesXYZ()
  311. WeldLib[weld]={[0]=v3(mdeg(x0),mdeg(y0),mdeg(z0)),[1]=v3(mdeg(x1),mdeg(y1),mdeg(z1))}
  312. end
  313. local perc =smooth==1 and math.sin((math.pi/2)/loops*i) or i/loops
  314. --print(weld.Part1)
  315. local tox,toy,toz = 0,0,0
  316. tox = origangle.x > nextangle.x and -math.abs(origangle.x - nextangle.x) *perc or math.abs(origangle.x - nextangle.x) *perc
  317. toy = origangle.y > nextangle.y and -math.abs(origangle.y - nextangle.y) *perc or math.abs(origangle.y - nextangle.y) *perc
  318. toz = origangle.z > nextangle.z and -math.abs(origangle.z - nextangle.z) *perc or math.abs(origangle.z - nextangle.z) *perc
  319. local tox2,toy2,toz2 = 0,0,0
  320. tox2= origpos.x > nextpos.x and -math.abs(origpos.x - nextpos.x) *perc or math.abs(origpos.x - nextpos.x) *perc
  321. toy2= origpos.y > nextpos.y and -math.abs(origpos.y - nextpos.y) *perc or math.abs(origpos.y - nextpos.y) *perc
  322. toz2= origpos.z > nextpos.z and -math.abs(origpos.z - nextpos.z) *perc or math.abs(origpos.z - nextpos.z) *perc
  323. WeldLib[weld][CO] = v3(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  324. weld['C'..CO] = cn(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2)*ca(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  325. end
  326. function FindSurface(part, position)
  327. local obj = part.CFrame:pointToObjectSpace(position)
  328. local siz = part.Size/2
  329. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  330. local vec = Vector3.FromNormalId(v)
  331. local wvec = part.CFrame:vectorToWorldSpace(vec)
  332. local vz = (obj)/(siz*vec)
  333. if (math.abs(vz.X-1) < 0.01 or math.abs(vz.Y-1) < 0.01 or math.abs(vz.Z-1) < 0.01) then
  334. return wvec,vec
  335. end
  336. end
  337. if part.className == "WedgePart" then
  338. return part.CFrame:vectorToWorldSpace(Vector3.new(0,0.707,-0.707)), Vector3.new(0,0.707,-0.707)
  339. end
  340. end
  341. LoopFunctions={}
  342. function DoLoop(times,func)
  343. LoopFunctions[#LoopFunctions+1]={times,0,func}
  344. end
  345. pcall(function() Torso.LAW:Remove() Torso.RAW:Remove() Torso.LLW:Remove() Torso.RLW:Remove() end)
  346. LAW=iNew{'Weld',Torso,Name='LAW',Part0=Torso,C0=cn(-1.5,0.5,0),C1=cn(0,0.5,0)}
  347. RAW=iNew{'Weld',Torso,Name='RAW',Part0=Torso,C0=cn( 1.5,0.5,0),C1=cn(0,0.5,0)}
  348. LLW=iNew{'Weld',Torso,Name='LLW',Part0=Torso,C0=cn(-0.5, -1,0),C1=cn(0, 1,0)}
  349. RLW=iNew{'Weld',Torso,Name='RLW',Part0=Torso,C0=cn( 0.5, -1,0),C1=cn(0, 1,0)}
  350. function Arms(on)
  351. LAM.Parent=Torso LAM.Part0=Torso
  352. RAM.Parent=Torso RAM.Part0=Torso
  353. LAM.Part1=on and nil or LA
  354. RAM.Part1=on and nil or RA
  355. LAW.Part1=on and LA or nil
  356. RAW.Part1=on and RA or nil
  357. end
  358. function Legs(on)
  359. LLM.Part1=on and nil or LL
  360. RLM.Part1=on and nil or RL
  361. LLW.Part1=on and LL or nil
  362. RLW.Part1=on and RL or nil
  363. end
  364.  
  365. _G.MGear=getfenv()
  366. pcall(function() _G.MGearS.Disabled=true end)
  367. _G.MGearS=script
  368.  
  369. pcall(function() Char.Gear:Remove() end)
  370. Gear=iNew{'Model',Char,Name='Gear'}
  371. Gt={[-1]={},[1]={}}
  372. for x=-1,1,2 do
  373. local base=iPart{Gear,0.6,3,0.8} iNew{'Weld',LastMade,Part0=x==-1 and LL or RL,Part1=LastMade,C0=cn(0.8*x,0.05,0.45)*ca(-80,0,6*x)}
  374. local v=iPart{Gear,0.5,2.5,0.5,co='Light stone grey'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,-0.24,0.6)} iNew{'CylinderMesh',v}
  375. local v=iPart{Gear,0.5,0.5,0.5,co='Light stone grey'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,1.01,0.6)} iNew{'SpecialMesh',v,MeshType='Sphere'}
  376. for z=-1.2,0.81,1 do
  377. local v=iPart{Gear,0.65,0.22,1.35,co='Dark stone grey'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,z,0.22)}
  378. end
  379. local v=iPart{Gear,0.25,0.5,0.25,co='Dark stone grey'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,1.25,0.6)*ca(0,0,90)} iNew{'CylinderMesh',v}
  380. local v=iPart{Gear,0.3,0.3,0.3,co='Black'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(0,1.25,0.6)*ca(0,0,90)} iNew{'CylinderMesh',v}
  381. local st,en=-0.3,0.3 local co=(st*-1+en)/4
  382. for xx=st,en,co do --sheath holes
  383. local v=iPart{Gear,0.2,0.2,0.7,co='Really black'} iNew{'Weld',v,Part0=base,Part1=v,C0=cn(xx+co/2,1.5,0)} iNew{'BlockMesh',v,Scale=v3(0.4,0.1,1)}
  384. end
  385. local v=iPart{Gear,0.75,0.2,0.75} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0.6*x,-0.65,1.1)*ca(45,0,-45*x)} iNew{'CylinderMesh',v}
  386. local v=iPart{Gear,0.6,0.22,0.6,co='Dark stone grey'} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0.6*x,-0.65,1.1)*ca(45,0,-45*x)} iNew{'CylinderMesh',v}
  387. local v2=iPart{Gear,0.2,0.2,0.2} iNew{'Weld',v2,Part0=v,Part1=v2,C0=cn(0,-0.35,0)*ca(180,0,0)} iNew{'SpecialMesh',v2,Scale=v3(0.3,0.65,0.3),MeshId=as.cone}
  388. local v2=iPart{Gear,0.2,0.2,0.3} iNew{'Weld',v2,Part0=v,Part1=v2,C0=ca(0,200*x,0)*cn(0,0,-0.5)}
  389. --sword handle
  390. local h=iPart{Gear,0.3,1.05,0.3} local hw=iNew{'Weld',h,Part0=x==-1 and LA or RA,Part1=h,C0=cn(0,-1,0)*ca(-90,0,0)} iNew{'CylinderMesh',h}
  391. Gt[x].h=hw
  392. local v=iPart{Gear,0.32,0.2,0.32,co='Black'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,-0.35,0)} iNew{'CylinderMesh',v}
  393. local v=iPart{Gear,0.2,0.5,0.25} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.25,-0.15)}
  394. local v=iPart{Gear,0.21,0.2,0.25,co='Black'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.25+0.12,-0.125)}
  395. local v=iPart{Gear,0.21,0.2,0.25,co='Black'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.25-0.12,-0.125)}
  396. local v=iPart{Gear,0.3,0.2,0.3} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.6,0)}
  397. local v=iPart{Gear,0.3,0.2,0.3,type='WedgePart'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.6,-0.3)}
  398. local v=iPart{Gear,0.3,0.2,0.3,type='WedgePart'} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,0.6, 0.3)*ca(180,0,0)}
  399. local v=iPart{Gear,0.2,0.5,0.2} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0, 0.3,-0.4)*ca( 14,0,0)} iNew{'CylinderMesh',v,Scale=v3(0.6,1,0.6)}
  400. local v=iPart{Gear,0.2,0.2,0.2} iNew{'Weld',v,Part0=h,Part1=v,C0=cn(0,-0.25,-0.35)*ca(-20+180,0,0)} iNew{'SpecialMesh',v,MeshId=as.cone,Scale=v3(0.06,1,0.06)}
  401. --sword blade
  402. local bladelength=4
  403. local blade=iPart{Gear,0.2,bladelength,0.4} iNew{'Weld',v,Part0=h,Part1=blade,C0=cn(0,0.7+bladelength/2,0.05)} iNew{'BlockMesh',blade,Scale=v3(0.4,1,1)}
  404. local tip=iPart{Gear,0.2,0.5,0.4,type='WedgePart'} iNew{'Weld',v,Part0=blade,Part1=tip,C0=cn(0,bladelength/2+0.25,0)*ca(0,180,0)} iNew{'SpecialMesh',tip,MeshType='Wedge',Scale=v3(0.4,1,1)}
  405. for i=-1.6,1.4,0.6 do
  406. local v=iPart{Gear,0.2,0,0.52,co='White'} iNew{'Weld',v,Part0=blade,Part1=v,C0=cn(0,i+0.1,0)*ca(40,0,0)} iNew{'BlockMesh',v,Scale=v3(0.42,0.3,1)}
  407. end
  408.  
  409. blade.Touched:connect(function(hit)
  410. if debounce == false then
  411. debounce = true
  412. isPlayer = hit.Parent:FindFirstChild("Humanoid")
  413. if isPlayer then
  414. isPlayer:TakeDamage(10)
  415. wait(0.5)
  416. end
  417. debounce = false
  418. end
  419. end)
  420. end
  421. --Middle
  422. local v=iPart{Gear,0.2,0.2,0.2} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0,-1,1.1)*ca(90,0,0)} iNew{'SpecialMesh',v,Scale=v3(0.4,1.6,0.16),MeshId=as.cone}
  423. Gas=iNew{'Smoke',v,Opacity=0.4,RiseVelocity=25,Size=3,Enabled=false}
  424. local v=iPart{Gear,0.6,0.3,0.6} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0,-0.85,0.8)} iNew{'CylinderMesh',v}
  425. local v=iPart{Gear,0.3,0.3,0.35,co='Dark stone grey',type='WedgePart'} iNew{'Weld',v,Part0=Torso,Part1=v,C0=cn(0,-0.9,1.2)*ca(0,180,0)}
  426. local belt=iPart{Gear,2.01,0.3,1.01,co='Black'} iNew{'Weld',belt,Part0=Torso,Part1=belt,C0=cn(0,-0.7,0)}
  427. for x=-1,1,2 do --continuesides
  428. local of=iPart{Gear,0.3,1.2,0.3} iNew{'Weld',belt,Part0=belt,Part1=of,C0=cn(1.15*x,-0.1,0)*ca(-80,0,0)}
  429. local v=iPart{Gear,0.3,1.2,0.3} iNew{'Weld',v,Part0=of,Part1=v,C0=cn(0,0,0.15)} iNew{'CylinderMesh',v}
  430. local v=iPart{Gear,0.2,0.2,0.2,co='Really black'} iNew{'Weld',v,Part0=of,Part1=v,C0=cn(0,0.51,0.15)} iNew{'CylinderMesh',v}
  431. Gt[x].grap=v
  432.  
  433. end
  434.  
  435. for i,v in pairs(Torso:children()) do
  436. if v:IsA'Sound' then v:Remove() end
  437. end
  438. for i,n in pairs(so) do
  439. if as[n] then
  440. local v=iNew{'Sound',Torso,Volume=0.5,Pitch=1,Looped=false,Name=n,SoundId=as[n]}
  441. so[n]=v
  442. end
  443. end
  444.  
  445.  
  446. key={}
  447.  
  448. print(#Gear:children())
  449. Root.C0=cn(0,0,0)*ca(0,0,0)
  450. Root.C1=cn(0,0,0)*ca(0,0,0)
  451.  
  452. WalkAnim=0
  453. Walking=false
  454. WalkM=8
  455. Humanoid.Running:connect(function(Walk)
  456. Walking=Walk>20 and true or false
  457. end)
  458.  
  459. --LL.Touched:connect(function() if Torso.Velocity.magnitude>30 then Torso.Velocity=nov3 end end)
  460. --RL.Touched:connect(function() if Torso.Velocity.magnitude>30 then Torso.Velocity=nov3 end end)
  461. _G.Torso=Torso
  462.  
  463. wait()
  464. Arms(true)
  465. Legs()
  466. GetCurrent=function()
  467. cLA,cLA2=GetWeld(LAW,0)
  468. cRA,cRA2=GetWeld(RAW,0)
  469. cLL,cLL2=GetWeld(LLW,0)
  470. cRL,cRL2=GetWeld(RLW,0)
  471. cRO,cRO2=GetWeld(Root,0)
  472. cNE,cNE2=GetWeld(Neck,0)
  473. end
  474. ReturnAnim=function()
  475. GetCurrent()
  476. local ogt={[-1]={},[1]={}}
  477. for x=-1,1,2 do ogt[x][1],ogt[x][2]=GetWeld(Gt[x].h,0) end
  478. local walk=WalkAnim~=0
  479. for x=1,ASpeed do
  480. SetWeld(LAW,0,x,ASpeed,cLA,cLA2,OrigLA,walk and Walk1*WAPerc or OrigLA2,1)
  481. SetWeld(RAW,0,x,ASpeed,cRA,cRA2,OrigRA,walk and Walk2*WAPerc or OrigRA2,1)
  482. if Hooks[-1] or Hooks[1] then else
  483. SetWeld(LLW,0,x,ASpeed,cLL,cLL2,OrigLL,OrigLL2,1)
  484. SetWeld(RLW,0,x,ASpeed,cRL,cRL2,OrigRL,OrigRL2,1) end
  485. SetWeld(Root,0,x,ASpeed,cRO,cRO2,OrigRO,walk and Walk3*WAPerc or OrigRO2,1)
  486. SetWeld(Neck,0,x,ASpeed,cNE,cNE2,OrigNE,walk and Walk4*WAPerc or OrigNE2,1)
  487. for h=-1,1,2 do SetWeld(Gt[h].h,0,x,ASpeed,ogt[h][1],ogt[h][2],v3(0,-1,0),v3(-90,0,0),1) end
  488. wait()
  489. end
  490. end
  491.  
  492. SpecialAttack=function(TYPE)
  493. if TYPE==1 then
  494. GetCurrent()
  495. if Controls.Parent then Humanoid.Jump=true end
  496. local legwas=LLW.Part1==LL and true or false
  497. Legs(true)
  498. for x=1,ASpeed/2 do
  499. SetWeld(LAW,0,x,ASpeed/2,cLA,cLA2,OrigLA+v3(0,0.8,-0.2),v3(190,0, 10,1),1)
  500. SetWeld(RAW,0,x,ASpeed/2,cRA,cRA2,OrigRA+v3(0,0.8,-0.2),v3(190,0,-10,1),1)
  501. for h=-1,1,2 do SetWeld(Gt[h].h,0,x,ASpeed/2,v3(0,-1,0),v3(-90,0,0),v3(0,-1.25,0),v3(-135,0,0),1) end
  502. SetWeld(LLW,0,x,ASpeed/2,cLL,cLL2,OrigLL+v3(0,0.6,-0.7),v3(-30,0,-10,1),1)
  503. SetWeld(RLW,0,x,ASpeed/2,cRL,cRL2,OrigRL+v3(0,0.6,-0.7),v3(-30,0,10,1),1)
  504. SetWeld(Root,0,x,ASpeed/2,cRO,cRO2,OrigRO,v3(90,0,0,1),1)
  505. wait()
  506. end
  507. local spin,ii=360,3
  508. for i=0,spin,spin/12 do
  509. ii=ii+1 if ii%4==0 then so.Slash:Play() end
  510. Root.C0=ca(90-i,0,0)
  511. wait()
  512. end
  513. ClearWeld(Root)
  514. ReturnAnim() Legs(legwas)
  515. elseif TYPE==2 then
  516. end
  517. end
  518.  
  519. pcall(function() Torso.BG:Remove() Torso.RP:Remove() end)
  520. BG=iNew{'BodyGyro',Torso,Name='BG',maxTorque=nov3}
  521. BP=iNew{'RocketPropulsion',Torso,Name='RP'}
  522. local rocketprop=iPart{Gear,1,1,1,an=true,cf=cn(0,-100,0),tr=1}
  523. rocketprop.CanCollide=false
  524. BP.Target=rocketprop
  525. BP.ThrustP=5
  526. BP.MaxTorque=nov3 --v3(400000,400000,0)
  527. BP.MaxThrust=4000
  528. BP.MaxSpeed=30
  529. --BP.CartoonFactor=1
  530. BP.TurnP,BP.TurnD=0,0
  531. BP.ThrustD=0.03 --BP.ThrustD*30
  532. BP.ThrustP=BP.ThrustP/1.5
  533. BP.TargetRadius=0
  534.  
  535. pcall(function() workspace.Camera.Inv:Remove() end)
  536. Inv=iNew{'Model',workspace.Camera,Name='Inv'}
  537.  
  538. Hooks={}
  539. HookP={[-1]={},[1]={}}
  540. Hit=nil
  541. Grapple={}
  542. key={}
  543. mouse=Player:GetMouse()
  544. mouse.KeyDown:connect(function(k)
  545. coroutine.resume(coroutine.create(function()
  546. key[k]=true
  547. local gp={['q']=-1,['e']=1}
  548. if k=='2' then
  549. elseif (k==' ') and Controls.Parent==nil then
  550. if WallWalk then WallWalk=false return end
  551. WallWalk=false
  552. Controls.Parent=game:service'ControllerService'
  553. Humanoid.Sit=false
  554. Legs(false)
  555. OrigRO=v3(0,0,0)
  556. Root.C0=cn(OrigRO)
  557. ---
  558. elseif k=='0' and Controls.Parent==nil and not Gas.Enabled and not WallWalking then
  559. local bv=iNew{'BodyVelocity',Torso}
  560. Gas.Enabled=true
  561. repeat
  562. local ss=(Hooks[1] or Hooks[-1]) and 5000 or 2000
  563. bv.maxForce=v3(ss,2000,ss)
  564. bv.velocity=Torso.CFrame.lookVector*125
  565. wait()
  566. until not key[k] or Controls.Parent
  567. Gas.Enabled=false
  568. bv:Remove()
  569. elseif (k=='q' or k=='e') and not Grapple[k] then
  570. so.Slash:Play()
  571. Grapple[k]=true
  572. local x=gp[k]
  573. local ob1=Gt[x].grap
  574. local speed=26
  575. local hook=iPart{Gear,1,1,1,co='Black',an=true,cf=cn(ob1.Position,mouse.Hit.p)*ca(-90,0,0)} iNew{'SpecialMesh',hook,Scale=v3(0.4,2,0.4),MeshId=as.cone}
  576. local rope=iPart{Gear,1,1,1,co='Black',an=true,cf=cf} local ropem=iNew{'CylinderMesh',rope}
  577. hook.CanCollide=false
  578. rope.CanCollide=false
  579. local con=game:GetService'RunService'.RenderStepped:connect(function()
  580. local mag=(ob1.Position-hook.Position).magnitude
  581. ropem.Scale=v3(0.2,mag,0.2)
  582. rope.CFrame=cn(ob1.Position,hook.Position)*cn(0,0,-mag/2)*ca(90,0,0)
  583. if not rope or not rope.Parent then con:disconnect() end
  584. end)
  585. for i=1,200 do
  586. if not key[k] then break end
  587. local hit,pos=ray(hook.Position,hook.Position-hook.CFrame*cn(0,-speed,0).p,Char,speed+1)
  588. if not hit then
  589. hook.CFrame=hook.CFrame*cn(0,speed,0)*ca(-0.1,0,0)
  590. else
  591. hook.CFrame=hook.CFrame*cn(0,(hook.Position-pos).magnitude,0)
  592. end
  593. local mag=(ob1.Position-hook.Position).magnitude
  594. if hit and hit.Transparency<1 and hit.CanCollide then
  595. Hit=hit
  596. HookP[x]={Hit,Hit.CFrame:toObjectSpace(hook.CFrame),pos}
  597. so.Block:Play()
  598. Hooks[x]=hook
  599. Humanoid.Sit=true
  600. Legs(true)
  601. OrigRO=v3(0,1,0)
  602. Root.C0=cn(OrigRO)
  603. Controls.Parent=nil
  604. break
  605. end
  606. wait()
  607. end
  608. ---
  609. if Hit then
  610. --hook.Reflectance=0.1
  611. end
  612. repeat wait()
  613. until not key[k] or Controls.Parent --relase
  614. Hooks[x]=nil
  615. hook:Remove()
  616. rope:Remove()
  617. Grapple[k]=false
  618. elseif k=='f' and LegAnim=='None' and TorsoAnim=='None' and LegAnim=='None' then
  619. ArmAnim,LegAnim,TorsoAnim='','',''
  620. SpecialAttack(1)
  621. ArmAnim,LegAnim,TorsoAnim='None','None','None'
  622. elseif k=='p' then
  623. local mpos=mouse.Hit.p
  624. local wall=iPart{Char,1,1,1,an=true}
  625. repeat
  626. local mag=(mpos-mouse.Hit.p).magnitude
  627. wall.Size=v3(not key.l and 4 or 0.5,200,mag)
  628. wall.CFrame=cn(mpos,mouse.Hit.p)*cn(0,100,-mag/2)
  629. wait() until not key.p
  630. local cf=wall.CFrame wall.Parent=workspace wall.CFrame=cf wall.CanCollide=true
  631. elseif k=='l' then
  632. wotm8=wotm8 and wotm8+150 or 75
  633. iPart{workspace,120,30,120,an=true,cf=cn(0,180,wotm8+100)*ca(0,mran(-40,40),0)}.CanCollide=true
  634. iPart{workspace,146,4,120,an=true,cf=cn(0,1,wotm8+100)}.CanCollide=true
  635. --elseif k=='w' and (not Hooks[-1] and not Hooks[1]) then
  636. --Humanoid.PlatformStand=false
  637. end
  638. end)) end)
  639. mouse.KeyUp:connect(function(k)
  640. coroutine.resume(coroutine.create(function()
  641. key[k]=false
  642.  
  643. end)) end)
  644. mouse.Button1Down:connect(function()
  645. Button1=true
  646. if ArmAnim=='None' then
  647. ArmAnim,TorsoAnim='Attack','Attack'
  648. thesteerclick=thesteerclick==1 and -1 or 1
  649. local y=thesteerclick
  650. GetCurrent()
  651. local ASpeed=ASpeed/1.5
  652. for x=1,ASpeed do
  653. SetWeld(LAW,0,x,ASpeed,cLA,cLA2,OrigLA,v3(0,-135*y,(-90-LookAngle/2)*y),1)
  654. SetWeld(RAW,0,x,ASpeed,cRA,cRA2,OrigRA,v3(0,-135*y,(-90-LookAngle/2)*y),1)
  655. SetWeld(Root,0,x,ASpeed,cRO,cRO2,OrigRO,v3(0,-90*y,0),1)
  656. SetWeld(Neck,0,x,ASpeed,cNE,cNE2,OrigNE,v3(0,90*y/3,0),1)
  657. for h=-1,1,2 do SetWeld(Gt[h].h,0,x,ASpeed,v3(0,-1,0),v3(-90,0,0),v3(0,-1.25,0),v3(-180,0,0),1) end
  658. wait()
  659. end
  660. GetCurrent()
  661. so.Slash:Play()
  662. for x=1,ASpeed do
  663. SetWeld(LAW,0,x,ASpeed,cLA,cLA2,OrigLA+v3(0,0,-0.8),v3(0,-30*y,(-90-LookAngle/2)*y),1)
  664. SetWeld(RAW,0,x,ASpeed,cRA,cRA2,OrigRA+v3(0,0,-0.8),v3(0,-30*y,(-90-LookAngle/2)*y),1)
  665. SetWeld(Root,0,x,ASpeed,cRO,cRO2,OrigRO,v3(0,80*y,0),1)
  666. SetWeld(Neck,0,x,ASpeed,cNE,cNE2,OrigNE,v3(0,-80*y/3,0),1)
  667. wait()
  668. end
  669. ReturnAnim()
  670. ArmAnim,TorsoAnim='None','None'
  671. end
  672. end)
  673. mouse.Button1Up:connect(function()
  674. Button1=false
  675.  
  676. end)
  677.  
  678.  
  679. LegAnim='None'
  680. ArmAnim='None'
  681. TorsoAnim='None'
  682. WalkSpeed={1,1,1,1,1,1,1,1}
  683. ASpeed=8
  684. OrigLA=v3(-1.5,0.5,0) OrigLA2=v3(5,0,-30)
  685. OrigRA=v3( 1.5,0.5,0) OrigRA2=v3(5,0,30)
  686. OrigLL=v3(-0.5,-1,0) OrigLL2=v3(0,0,0)
  687. OrigRL=v3( 0.5,-1,0) OrigRL2=v3(0,0,0)
  688. OrigRO=v3(0,0,0) OrigRO2=v3(0,0,0)
  689. OrigNE=v3(0,1.5,0) OrigNE2=v3(0,0,0)
  690. -----
  691. --c/local x,y,z=workspace.RobroxMasterDX.Torso["Left Hip"].C0:toEulerAnglesXYZ() print(math.deg(y))
  692. rocketfired=false
  693. local spi,spix,span=0,0.5,1
  694. while Gear.Parent do
  695. local headpos,mousepos=Head.Position,mouse.Hit.p
  696. XAngle=math.floor(cn(headpos,mousepos).lookVector.y*180)
  697. LookAngle=XAngle<-20 and -20 or (XAngle>45 and 45 or XAngle)
  698. WalkAnim=WalkAnim+(ArmAnim=='None' and (Walking and 1 or -1) or 0)
  699. if WalkAnim<0 then WalkAnim=0 elseif WalkAnim>WalkM then WalkAnim=WalkM end
  700. WAPerc=WalkAnim/WalkM
  701. spi=spi+spix
  702. local adj=spi*8
  703. if math.abs(spi)>=span then spix=spix*-1 end
  704. Walk1,Walk2,Walk3,Walk4=v3(0,90,-90+25+adj),v3(0,-90,90-25-adj),v3(-18-adj,0,spi*1.5),v3(18+adj,0,-spi*1.5)
  705. if ArmAnim=='None' then
  706. SetWeld(LAW,0,WalkAnim,WalkM,OrigLA,OrigLA2,OrigLA,Walk1,1)
  707. SetWeld(RAW,0,WalkAnim,WalkM,OrigRA,OrigRA2,OrigRA,Walk2,1)
  708. end
  709. if TorsoAnim=='None' then
  710. SetWeld(Root,0,WalkAnim,WalkM,OrigRO,OrigRO2,OrigRO,Walk3,1)
  711. SetWeld(Neck,0,WalkAnim,WalkM,OrigNE,OrigNE2,OrigNE,Walk4,1)
  712. end
  713. local ws=28 for i=1,#WalkSpeed do ws=ws*WalkSpeed[i] end Humanoid.WalkSpeed=ws
  714. --DoLoop Package
  715. for i,v in pairs(LoopFunctions) do
  716. v[2]=v[2]+1
  717. v[3](v[2]/v[1])
  718. if v[1]<=v[2] then LoopFunctions[i]=nil end
  719. end
  720. for x=-1,1,2 do
  721. if Hooks[x] then Hooks[x].CFrame=HookP[x][1].CFrame*HookP[x][2] end
  722. end
  723. if Hooks[-1] or Hooks[1] then
  724. local hook=(Hooks[1] and Hooks[-1]) and 0 or Hooks[1] or Hooks[-1]
  725. HookPos=hook==0 and Hooks[1].Position+(Hooks[-1].Position-Hooks[1].Position)/2 or hook.CFrame.p
  726. BP.MaxTorque=v3(0,0,0) BP.MaxSpeed=200 BP.MaxThrust=10*10000
  727. rocketprop.CFrame=cn(HookPos+v3(0,4,0))
  728. if not rocketfired then BP:Fire() rocketfired=true end
  729. else BP.MaxTorque=nov3
  730. if rocketfired then BP:Abort() rocketfired=false end
  731. end
  732. if Humanoid.Sit and not WallWalking then
  733. SetWeld(LLW,0,1,1,OrigLL,OrigLL2,OrigLL+v3(0,0.6,-0.7),v3(-30,0,-14,1),1)
  734. SetWeld(RLW,0,1,1,OrigRL,OrigRL2,OrigRL+v3(0,0.6,-0.7),v3(-30,0, 14,1),1)
  735. if not WallWalking then BG.cframe=cn(Torso.Position,mouse.Hit.p)*cn(0,0,-1) end --TweenCF(3,9,bg.CFrame,cn(Torso.Position,mouse.Hit.p))*cn(0,0,-1)
  736. BG.maxTorque=maxv3 --workspace.Camera.CoordinateFrame*cn(0,0,-1000).p
  737. else
  738. if not WallWalking then BG.maxTorque=nov3 end
  739. end
  740. wait()
  741. end --TweenV3(0.5,1,Hooks[1].Position,Hooks[-1].Position)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement