Advertisement
ghostteen14

Untitled

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