Advertisement
Tremfeiror

Untitled

Nov 12th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.45 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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6. local Handle = Instance.new("Part", game.Players.LocalPlayer.Character)
  7. Handle:BreakJoints()
  8. Handle.TopSurface = "Smooth"
  9. Handle.Material = "SmoothPlastic"
  10. Handle.Name = 'Handle'
  11. Handle.Transparency=1
  12. Handle.BottomSurface = "Smooth"
  13. Handle.FormFactor = "Custom" Handle.CanCollide = false
  14. Handle.BrickColor = BrickColor.new("Medium stone grey")
  15. Handle.Size = Vector3.new(0.5, 4.9000001, 0.799999833)
  16. local Handleweld = Instance.new("ManualWeld")
  17. Handleweld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  18. Handleweld.Part1 = Handle Handleweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  19. Handleweld.C1 = CFrame.new(-0.0500130653, -0.15998745, 0.999988556, 1, 0, 0, 0, 0, -1, 0, 0.999999881, 0)
  20. Handleweld.Parent = game.Players.LocalPlayer.Character["Right Arm"]
  21. staffweld=Handleweld
  22. Handlecf=Handleweld.C1
  23. local Grip = Instance.new("Part", game.Players.LocalPlayer.Character)
  24. Grip:BreakJoints()
  25. Grip.TopSurface = "Smooth"
  26. Grip.Material = "SmoothPlastic"
  27. Grip.Name = 'Grip'
  28. Grip.BottomSurface = "Smooth"
  29. Grip.FormFactor = "Custom" Grip.CanCollide = false
  30. Grip.BrickColor = BrickColor.new("Toothpaste")
  31. Grip.Size = Vector3.new(0.400000006, 4, 0.400000006)
  32. local Gripweld = Instance.new("ManualWeld")
  33. Gripweld.Part0 = Handle Gripweld.Part1 = Grip Gripweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  34. Gripweld.C1 = CFrame.new(0.0500068665, 0.449998379, 5.96046448e-006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  35. Gripweld.Parent = Grip
  36. local GripMesh = Instance.new("CylinderMesh",Grip)
  37. GripMesh.Name = "Mesh"
  38. GripMesh.Offset = Vector3.new(0, 0, 0)
  39. GripMesh.Scale = Vector3.new(1, 1, 1)
  40.  
  41. local Down = Instance.new("WedgePart", game.Players.LocalPlayer.Character)
  42. Down:BreakJoints()
  43. Down.TopSurface = "Smooth"
  44. Down.Material = "SmoothPlastic"
  45. Down.Name = 'Down'
  46. Down.BottomSurface = "Smooth"
  47. Down.FormFactor = "Custom" Down.CanCollide = false
  48. Down.BrickColor = BrickColor.new("Toothpaste")
  49. Down.Size = Vector3.new(0.200000003, 1, 0.400000006)
  50. local Downweld = Instance.new("ManualWeld")
  51. Downweld.Part0 = Handle Downweld.Part1 = Down Downweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  52. Downweld.C1 = CFrame.new(0.0500155687, -1.95003223, 0.19999814, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  53. Downweld.Parent = Down
  54. local Connector = Instance.new("Part", game.Players.LocalPlayer.Character)
  55. Connector:BreakJoints()
  56. Connector.TopSurface = "Smooth"
  57. Connector.Material = "SmoothPlastic"
  58. Connector.Name = 'Connector'
  59. Connector.Shape="Ball"
  60. Connector.BottomSurface = "Smooth"
  61. Connector.FormFactor = "Custom" Connector.CanCollide = false
  62. Connector.BrickColor = BrickColor.new("Toothpaste")
  63. Connector.Size = Vector3.new(0.400000006, 0.400000006, 0.400000006)
  64. Connectorweld = Instance.new("ManualWeld")
  65. Connectorweld.Part0 = Handle Connectorweld.Part1 = Connector Connectorweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  66. Connectorweld.C1 = CFrame.new(0.0500068665, -1.55001354, 6.91413879e-006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  67. Connectorweld.Parent = Connector
  68. local Up = Instance.new("WedgePart", game.Players.LocalPlayer.Character)
  69. Up:BreakJoints()
  70. Up.TopSurface = "Smooth"
  71. Up.Material = "SmoothPlastic"
  72. Up.Name = 'Up'
  73. Up.BottomSurface = "Smooth"
  74. Up.FormFactor = "Custom" Up.CanCollide = false
  75. Up.BrickColor = BrickColor.new("Toothpaste")
  76. Up.Size = Vector3.new(0.200000003, 1, 0.400000006)
  77. local Upweld = Instance.new("ManualWeld")
  78. Upweld.Part0 = Handle Upweld.Part1 = Up Upweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  79. Upweld.C1 = CFrame.new(-0.0500155687, -1.95002747, 0.200003147, -1, 0, 0, 0, 1, 0, -0, 0, -1)
  80. Upweld.Parent = Up
  81. Connector.Material="Neon"
  82. Grip.Material="Neon"
  83. Up.Material="Neon"
  84. Down.Material="Neon"
  85. Player=game:GetService("Players").LocalPlayer
  86. Character=Player.Character
  87. Character.Animate:Destroy()
  88. PlayerGui=Player.PlayerGui
  89. Backpack=Player.Backpack
  90. Torso=Character.Torso
  91. Head=Character.Head
  92. Humanoid=Character.Humanoid
  93. Humanoid.WalkSpeed=32
  94. LeftArm=Character["Left Arm"]
  95. LeftLeg=Character["Left Leg"]
  96. RightArm=Character["Right Arm"]
  97. RightLeg=Character["Right Leg"]
  98. LS=Torso["Left Shoulder"]
  99. LH=Torso["Left Hip"]
  100. RS=Torso["Right Shoulder"]
  101. RH=Torso["Right Hip"]
  102. Neck=Torso.Neck
  103. it=Instance.new
  104. vt=Vector3.new
  105. cf=CFrame.new
  106. euler=CFrame.fromEulerAnglesXYZ
  107. angles=CFrame.Angles
  108. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  109. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  110. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  111. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  112. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  113. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  114. RootPart=Character.HumanoidRootPart
  115. RootJoint=RootPart.RootJoint
  116. RootCF=euler(-1.57,0,3.14)
  117. attack=false
  118. attackdebounce=false
  119. MMouse=nil
  120. combo=0
  121. local Anim="Idle"
  122. player=nil
  123. --save shoulders
  124. RSH, LSH=nil, nil
  125. --welds
  126. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  127. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  128. LH=Torso["Left Hip"]
  129. RH=Torso["Right Hip"]
  130.  
  131.  
  132. function clerp(a,b,t)
  133. local qa = {QuaternionFromCFrame(a)}
  134. local qb = {QuaternionFromCFrame(b)}
  135. local ax, ay, az = a.x, a.y, a.z
  136. local bx, by, bz = b.x, b.y, b.z
  137. local _t = 1-t
  138. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  139. end
  140.  
  141. function QuaternionFromCFrame(cf)
  142. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  143. local trace = m00 + m11 + m22
  144. if trace > 0 then
  145. local s = math.sqrt(1 + trace)
  146. local recip = 0.5/s
  147. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  148. else
  149. local i = 0
  150. if m11 > m00 then
  151. i = 1
  152. end
  153. if m22 > (i == 0 and m00 or m11) then
  154. i = 2
  155. end
  156. if i == 0 then
  157. local s = math.sqrt(m00-m11-m22+1)
  158. local recip = 0.5/s
  159. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  160. elseif i == 1 then
  161. local s = math.sqrt(m11-m22-m00+1)
  162. local recip = 0.5/s
  163. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  164. elseif i == 2 then
  165. local s = math.sqrt(m22-m00-m11+1)
  166. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  167. end
  168. end
  169. end
  170.  
  171. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  172. local xs, ys, zs = x + x, y + y, z + z
  173. local wx, wy, wz = w*xs, w*ys, w*zs
  174. local xx = x*xs
  175. local xy = x*ys
  176. local xz = x*zs
  177. local yy = y*ys
  178. local yz = y*zs
  179. local zz = z*zs
  180. 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))
  181. end
  182.  
  183. function QuaternionSlerp(a, b, t)
  184. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  185. local startInterp, finishInterp;
  186. if cosTheta >= 0.0001 then
  187. if (1 - cosTheta) > 0.0001 then
  188. local theta = math.acos(cosTheta)
  189. local invSinTheta = 1/math.sin(theta)
  190. startInterp = math.sin((1-t)*theta)*invSinTheta
  191. finishInterp = math.sin(t*theta)*invSinTheta
  192. else
  193. startInterp = 1-t
  194. finishInterp = t
  195. end
  196. else
  197. if (1+cosTheta) > 0.0001 then
  198. local theta = math.acos(-cosTheta)
  199. local invSinTheta = 1/math.sin(theta)
  200. startInterp = math.sin((t-1)*theta)*invSinTheta
  201. finishInterp = math.sin(t*theta)*invSinTheta
  202. else
  203. startInterp = t-1
  204. finishInterp = t
  205. end
  206. end
  207. 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
  208. end
  209. function swait(num)
  210. if num==0 or num==nil then
  211. game:service'RunService'.RenderStepped:wait()
  212. else
  213. for i=0,num do
  214. game:service'RunService'.RenderStepped:wait()
  215. end
  216. end
  217. end
  218. function weld(parent,part0,part1,c0)
  219. local weld=it("Weld")
  220. weld.Parent=parent
  221. weld.Part0=part0
  222. weld.Part1=part1
  223. weld.C0=c0
  224. return weld
  225. end
  226. local function rs()
  227. game:GetService("RunService").RenderStepped:wait()
  228. end
  229.  
  230. Plr = game.Players.LocalPlayer
  231. P = Plr.Character
  232. Mouse = Plr:GetMouse()
  233.  
  234. ch = P
  235. RSH=ch.Torso["Right Shoulder"]
  236. LSH=ch.Torso["Left Shoulder"]
  237. RF, LF=Instance.new("Weld"), Instance.new("Weld")
  238. --
  239. RSH.Parent=nil
  240. LSH.Parent=nil
  241. --
  242. RW.Name="Right Shoulder"
  243. RW.Part0=ch.Torso
  244. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  245. RW.C1=cf(0, 0.5, 0)
  246. RW.Part1=ch["Right Arm"]
  247. RW.Parent=P.Torso
  248. --
  249. LW.Name="Left Shoulder"
  250. LW.Part0=ch.Torso
  251. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  252. LW.C1=cf(0, 0.5, 0)
  253. LW.Part1=ch["Left Arm"]
  254. LW.Parent=P.Torso
  255. --
  256. RF.Name="Right Hip"
  257. RF.Part0=ch.Torso
  258. RF.C0=cf(.5, -1.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  259. RF.C1=cf(0, 0.5, 0)
  260. RF.Part1=ch["Right Leg"]
  261. RF.Parent=P.Torso
  262. --
  263. LF.Name="Left Hip"
  264. LF.Part0=ch.Torso
  265. LF.C0=cf(-.5, -1.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  266. LF.C1=cf(0, 0.5, 0)
  267. LF.Part1=ch["Left Leg"]
  268. LF.Parent=P.Torso
  269. RFC0 = RF.C0
  270. LFC0 = LF.C0
  271. RWC0 = CFrame.new(1.5, 0.5, 0, -0.945518613, -0.32556811, 0, 0.32556811, -0.945518613, 0, 0, 0, 1)
  272. LWC0 = CFrame.new(-1.05161786, 0.471444488, -0.853310168, 0.459834456, -0.887635231, -0.0256112181, 0.116241433, 0.08876127, -0.989246905, 0.880363643, 0.451912731, 0.143995479)
  273. TC0 = RootJoint.C0
  274. HC0 = Torso.Neck.C0
  275.  
  276. local Rads = 14
  277. local sine = 0
  278. local Arms = true
  279. local Legs = true
  280. local AttArm = 0
  281. local AttLeg = 0
  282. local Enabled = true
  283.  
  284. function Walk()
  285. if Arms then
  286. RW.C0=clerp(RW.C0,cf(1.5, 0.5, 0)*euler(-math.rad(50),0,math.rad(30)),.3)
  287. RootJoint.C0=clerp(RootJoint.C0,RootCF*CFrame.Angles(math.rad(15),0,0),.3)
  288. Handleweld.C1=clerp(Handleweld.C1,Handlecf*CFrame.Angles(0,math.rad(90),0),.3)
  289. LW.C0=clerp(LW.C0,cf(-1.5+math.abs(math.sin(-sine)*.233), 0.5, math.sin(sine)*.233)*euler(-math.sin(sine)/1.5*(Humanoid.WalkSpeed/13),0,-math.sin(sine)/3*(Humanoid.WalkSpeed/13)),.3)
  290. end
  291. if Legs then
  292. RF.C0=clerp(RF.C0,cf(.5, -1.5, math.sin(sine)*.233)*euler(-math.sin(sine)/2*((Humanoid.WalkSpeed+8)/24),0,0),.5)
  293. LF.C0=clerp(LF.C0,cf(-.5, -1.5, math.sin(-sine)*.233)*euler(-math.sin(-sine)/2*((Humanoid.WalkSpeed+8)/24),0,0),.5)
  294. end
  295. sine = sine + math.rad(Rads)
  296. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.3)
  297. end
  298. function Aim()
  299. RW.C0=clerp(RW.C0,CFrame.new(1.5, 0.5, 0, -0.945518613, -0.32556811, 0, 0.32556811, -0.945518613, 0, 0, 0, 1),.3)
  300. LW.C0=clerp(LW.C0,CFrame.new(-1.05161786, 0.471444488, -0.853310168, 0.459834456, -0.887635231, -0.0256112181, 0.116241433, 0.08876127, -0.989246905, 0.880363643, 0.451912731, 0.143995479),.3)
  301. RootJoint.C0=clerp(RootJoint.C0,TC0,.3)
  302. Handleweld.C1=clerp(Handleweld.C1,Handlecf,.3)
  303. Torso.Neck.C0=clerp(Torso.Neck.C0,HC0,.3)
  304. if Vector3.new(P.Torso.Velocity.x, 0, P.Torso.Velocity.z).magnitude > 3 and Legs then
  305. RF.C0=clerp(RF.C0,cf(.5, -1.5, math.sin(sine)*.233)*euler(-math.sin(sine)/2*((Humanoid.WalkSpeed+8)/24),0,0),.5)
  306. LF.C0=clerp(LF.C0,cf(-.5, -1.5, math.sin(-sine)*.233)*euler(-math.sin(-sine)/2*((Humanoid.WalkSpeed+8)/24),0,0),.5)
  307. sine = sine + math.rad(Rads)
  308. end
  309. end
  310. function Idle()
  311. if Arms then
  312. RW.C0=clerp(RW.C0,cf(1.5, 0.5, 0)*CFrame.new(0, 0, 0, 0.862729907, -0.5, -0.0754789189, 0.49809736, 0.866025388, -0.0435777754, 0.0871555507, 0, 0.99619472),.3)
  313. LW.C0=clerp(LW.C0,cf(-1.5, 0.5, 0)*CFrame.new(0, 0, 0, 0.173648223, 0.98480773, 0, -0.98480773, 0.173648223, 0, 0, 0, 1),.3)
  314. RootJoint.C0=clerp(RootJoint.C0,RootCF*CFrame.Angles(0,0,-math.rad(70)),.3)
  315. Handleweld.C1=clerp(Handleweld.C1,Handlecf,.3)
  316. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,math.rad(70)),.3)
  317. end
  318. if Legs then
  319. RF.C0=clerp(RF.C0,RFC0*cf(0,0,0)*CFrame.new(0, -0, 0, 0.99619472, 0, -0.0871557817, 0, 1, 0, 0.0871557817, 0, 0.99619472),.3)
  320. LF.C0=clerp(LF.C0,LFC0*cf(0,0,0)*CFrame.new(0, -0, 0, 0.906307638, 0, 0.422618419, 0, 1, 0, -0.422618419, 0, 0.906307638),.3)
  321. end
  322. end
  323.  
  324. function Sound(ID,Par,Pitch,Vol)
  325. local Sound = Instance.new("Sound",Par)
  326. Sound.SoundId = "http://www.roblox.com/asset/?id="..tostring(ID)
  327. game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..tostring(ID))
  328. Sound.Pitch = Pitch
  329. Sound.Volume = Vol
  330. game.Debris:AddItem(Sound,Sound.TimeLength)
  331. rs()
  332. Sound:Play()
  333. end
  334. local aiming = false
  335. local Jumping = false
  336. local Jumpi = 0
  337.  
  338. game:GetService("RunService").Heartbeat:connect(function()
  339. if Jumping == true then
  340. Jumpi = Jumpi + 1
  341. if Arms then
  342. RW.C0=clerp(RW.C0,cf(1, 1, 0)*euler(0,0,math.pi/2+math.pi/4),.5)
  343. LW.C0=clerp(LW.C0,cf(-1, 1, 0)*euler(0,0,-math.pi/2-math.pi/4),.5)
  344. RootJoint.C0=clerp(RootJoint.C0,RootCF*euler(math.pi/16,0,0),.5)
  345. end
  346. if Legs then
  347. RF.C0=clerp(RF.C0,RFC0*cf(0,0,0)*euler(0,0,0),.5)
  348. LF.C0=clerp(LF.C0,LFC0*cf(0,.5,-.6)*euler(0,0,0),.5)
  349. end
  350. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.5)
  351. if Jumpi == 10 then
  352. Jumping = false
  353. Jumpi = 0
  354. end
  355. elseif Vector3.new(P.Torso.Velocity.x, 0, P.Torso.Velocity.z).magnitude < 3 then
  356. if aiming then
  357. Aim()
  358. else
  359. Idle()
  360. end
  361. elseif Vector3.new(P.Torso.Velocity.x, 0, P.Torso.Velocity.z).magnitude > 3 then
  362. if aiming then
  363. Aim()
  364. else
  365. Walk()
  366. end
  367. end
  368. end)
  369. P.Humanoid.Jumping:connect(function()
  370. if Arms == false and Legs == false then
  371. else
  372. Jumping = true
  373. end
  374. end)
  375. function hwait()
  376. game:GetService("RunService").Heartbeat:wait()
  377. end
  378. function Sound(ID,Par,Pitch,Vol)
  379. local Sound = Instance.new("Sound",Par)
  380. Sound.SoundId = "http://www.roblox.com/asset/?id="..tostring(ID)
  381. game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..tostring(ID))
  382. Sound.Pitch = Pitch
  383. Sound.Volume = Vol
  384. game.Debris:AddItem(Sound,Sound.TimeLength)
  385. rs()
  386. Sound:Play()
  387. end
  388. function Damage(Dmg,Part)
  389. local Child = Part
  390. local Par = Part.Parent
  391. if Par == workspace then
  392. elseif Par~=nil then
  393. repeat
  394. Child = Par
  395. Par = Par.Parent
  396. until Par == workspace
  397. end
  398. local Found = false
  399. function Search(c)
  400. coroutine.resume(coroutine.create(function()
  401. for i,v in pairs (c:GetChildren()) do
  402. if v:IsA("Humanoid") then
  403. for i = 1,10 do
  404. v.Health = v.Health - Dmg/10
  405. Found = true
  406. end
  407. end
  408. Search(v)
  409. end
  410. end))
  411. end
  412. if Child ~= P then
  413. Search(Child)
  414. end
  415. if Found == false then
  416. return false
  417. else
  418. return true
  419. end
  420. end
  421. neg={-1,1}
  422. Mouse.Button1Down:connect(function()
  423. if Enabled == true then
  424. Enabled = false
  425. Arms = false
  426. local Hit = false
  427. AttArm = AttArm + 1
  428. Handle.Touched:connect(function(part)
  429. if Hit == false then
  430. local Hitz = Damage(10,part)
  431. if Hitz == true then
  432. Hit = true
  433. end
  434. end
  435. end)
  436. if AttArm % 2 == 0 then
  437. for i = 0,1,0.05 do
  438. rs()
  439. RW.C0=clerp(RW.C0,CFrame.new(0.327810407, 0.426284045, -0.812734485, 0.499530673, 0.832429767, 0.23985371, -0.765840292, 0.553754687, -0.32687068, -0.404916912, -0.0204077363, 0.914125562),.3)
  440. LW.C0=clerp(LW.C0,cf(-1.5, 0.5, 0)*euler(0,0,-math.pi/16),.3)
  441. LW.C0=clerp(LW.C0,CFrame.new(-1.12515569, 0.390085489, -0.0568969324, 0.966400146, 0.0897351503, -0.240870312, -0.223289788, 0.757267952, -0.613748312, 0.127328619, 0.646910369, 0.751860738),.3)
  442. RF.C0=clerp(RF.C0,cf(.5, -1.5, 0)*euler(math.rad(30),0,0),.3)
  443. LF.C0=clerp(LF.C0,cf(-.5, -1.5, 0)*euler(-math.rad(30),0,0),.3)
  444. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.3)
  445. Handleweld.C1=clerp(Handleweld.C1,Handlecf*CFrame.new(0,0,1.5),.3)
  446. RootJoint.C0=clerp(RootJoint.C0,RootCF*CFrame.Angles(math.rad(0),0,0),.3)
  447.  
  448. end
  449. elseif AttArm % 2 == 1 then
  450. LW.C0=clerp(LW.C0,cf(-1.5, 0.5, 0)*euler(math.pi/2,0,0),1)
  451. for i = 0,1,0.05 do
  452. rs()
  453. RW.C0=clerp(RW.C0, CFrame.new(1.00035846, 0.481068671, 0, -0.838670492, -0.436109662, 0.326251596, 0.544639111, -0.671549916, 0.502383232, 0, 0.599023461, 0.80073148),.3)
  454. LW.C0=clerp(LW.C0,CFrame.new(0.418275297, 0.689788699, -0.483788908, -0.600420177, -0.779812098, 0.177168876, 0.799684703, -0.585499287, 0.133022174, 0, 0.221548468, 0.975149393),.3)
  455. RF.C0=clerp(RF.C0,cf(.5, -1.5, 0)*euler(-math.rad(30),0,0),.3)
  456. LF.C0=clerp(LF.C0,cf(-.5, -1.5, 0)*euler(math.rad(30),0,0),.3)
  457. Torso.Neck.C0=clerp(Torso.Neck.C0,necko*euler(0,0,0),.3)
  458. Handleweld.C1=clerp(Handleweld.C1,Handlecf*CFrame.new(0,0,1.5),.3)
  459. RootJoint.C0=clerp(RootJoint.C0,RootCF*CFrame.Angles(math.rad(0),0,0),.3)
  460.  
  461. end
  462. end
  463. Enabled=true
  464. Arms=true
  465. end
  466. end)
  467.  
  468. Mouse.KeyDown:connect(function(key)
  469. if key=="f" then
  470. aiming=true
  471. Arms=false
  472. Sound(334702864,Character.Torso,1,1)
  473. elseif key=="r" then
  474. local hint = Instance.new("Part",workspace)
  475. hint.Shape="Cylinder"
  476. Sound(334702864,hint,1,1)
  477. hint.Anchored=true
  478. hint.CanCollide=false
  479. hint.Material="Neon"
  480. hint.Transparency=1
  481. hint.BrickColor=BrickColor.new("Toothpaste")
  482. hint.Size=Vector3.new(.2,4,4)
  483. hint.CFrame=CFrame.new(Mouse.Hit.p)*CFrame.Angles(0,0,math.rad(90))
  484. for i = 1,30 do
  485. rs()
  486. hint.Transparency=1-i/30
  487. end
  488. local spear = Handle:Clone()
  489. spear.Anchored=true
  490. Connector:Clone().Parent=spear
  491. Up:Clone().Parent=spear
  492. Down:Clone().Parent=spear
  493. Grip:Clone().Parent=spear
  494. for i,v in pairs(spear:children'') do if v:IsA("BasePart") then v.Anchored=true else v:Remove() end end
  495. local parts = {spear.Connector,spear.Up,spear.Down,spear.Grip}
  496. local cframes = {CFrame.new(0.0500068665, -1.55001354, 6.91413879e-006, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.0500155687, -1.95002747, 0.200003147, -1, 0, 0, 0, 1, 0, -0, 0, -1),CFrame.new(0.0500155687, -1.95003223, 0.19999814, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0500068665, 0.449998379, 5.96046448e-006, 1, 0, 0, 0, 1, 0, 0, 0, 1)}
  497. spear.CFrame=CFrame.new((hint.CFrame*CFrame.new(-5,0,0)).p)
  498. spear.Parent=workspace
  499. spear.Touched:connect(function(v)
  500. if v.Parent~=nil then
  501. if v.Parent:FindFirstChild("Humanoid") and v.Parent~=Character then
  502. v.Parent.Humanoid.Health=v.Parent.Humanoid.Health-10
  503. end
  504. end
  505. end)
  506. for _,v in pairs(parts) do
  507. v.CFrame=spear.CFrame*cframes[_]:inverse()
  508. end
  509. for i = 1,10 do
  510. rs()
  511. spear.CFrame=spear.CFrame*CFrame.new(0,0.7,0)
  512. for _,v in pairs(parts) do
  513. v.CFrame=spear.CFrame*cframes[_]:inverse()
  514. end
  515. end
  516. spawn(function()
  517. wait(.5)
  518. spear:Destroy()
  519. Handleweld = Instance.new("ManualWeld")
  520. Handleweld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  521. Handleweld.Part1 = Character.Handle Handleweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  522. Handleweld.C1 = CFrame.new(-0.0500130653, -0.15998745, 0.999988556, 1, 0, 0, 0, 0, -1, 0, 0.999999881, 0)
  523. Handleweld.Parent = game.Players.LocalPlayer.Character["Right Arm"]
  524. hint:Remove()
  525. end)
  526. end
  527. end)
  528.  
  529. local enabled=true
  530. Mouse.KeyUp:connect(function(key)
  531. if key=="f" and enabled then
  532. aiming=false
  533. enabled=false
  534. Handleweld:Destroy()
  535. local temp = Handle
  536. temp.CanCollide=true
  537. local parts = {Connector,Up,Down,Grip}
  538. local cframes = {Connectorweld.C1,Upweld.C1,Downweld.C1,Gripweld.C1}
  539. local init = Mouse.Hit.p
  540. local dir = init - temp.Position
  541. for i,v in pairs(parts) do v.Anchored=true end Handle.Anchored=true
  542. spawn(function()
  543. for i = 1,200 do
  544. rs()
  545. for _,v in pairs(temp:GetTouchingParts()) do
  546. if v.Parent~=nil then
  547. if v.Parent:FindFirstChild("Humanoid") and v.Parent~=Character then
  548. v.Parent.Humanoid.Health=v.Parent.Humanoid.Health-5
  549. end
  550. end
  551. end
  552. local Distance = (init-temp.Position).magnitude
  553. if Distance > 2 then Distance = 2 end
  554. temp.CFrame = CFrame.new(temp.Position,init) * CFrame.new(0,0,-Distance) * CFrame.Angles(math.rad(-90),math.rad(90),0)
  555. for _,v in pairs(parts) do
  556. v.CFrame=temp.CFrame*cframes[_]:inverse()
  557. end
  558. end
  559. temp:Remove()
  560. for i,v in pairs(parts) do v:Remove() end
  561. end)
  562. for i = 1,10 do
  563. rs()
  564. RW.C0=clerp(RWC0,CFrame.new(1.5, 0.5, 0, -0.969445348, 0.175265431, 0.171632558, 0.245307371, 0.692642331, 0.678285301, 0, 0.699663281, -0.714472771),i/10)
  565. LW.C0=clerp(LWC0,CFrame.new(-1.5, 0.5, 0, 0.880477369, 0.474088192, 0, -0.0928957462, 0.172526136, -0.980614662, -0.464897841, 0.863409042, 0.195946127),i/10)
  566. end
  567. enabled=true
  568. Arms=true
  569. Handle = Instance.new("Part", game.Players.LocalPlayer.Character)
  570. Handle:BreakJoints()
  571. Handle.TopSurface = "Smooth"
  572. Handle.Material = "SmoothPlastic"
  573. Handle.Name = 'Handle'
  574. Handle.Transparency=1
  575. Handle.BottomSurface = "Smooth"
  576. Handle.FormFactor = "Custom" Handle.CanCollide = false
  577. Handle.BrickColor = BrickColor.new("Medium stone grey")
  578. Handle.Size = Vector3.new(0.5, 4.9000001, 0.799999833)
  579. Handleweld = Instance.new("ManualWeld")
  580. Handleweld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  581. Handleweld.Part1 = Handle Handleweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  582. Handleweld.C1 = CFrame.new(-0.0500130653, -0.15998745, 0.999988556, 1, 0, 0, 0, 0, -1, 0, 0.999999881, 0)
  583. Handleweld.Parent = game.Players.LocalPlayer.Character["Right Arm"]
  584. staffweld=Handleweld
  585. Handlecf=Handleweld.C1
  586. Grip = Instance.new("Part", game.Players.LocalPlayer.Character)
  587. Grip:BreakJoints()
  588. Grip.TopSurface = "Smooth"
  589. Grip.Material = "SmoothPlastic"
  590. Grip.Name = 'Grip'
  591. Grip.BottomSurface = "Smooth"
  592. Grip.FormFactor = "Custom" Grip.CanCollide = false
  593. Grip.BrickColor = BrickColor.new("Toothpaste")
  594. Grip.Size = Vector3.new(0.400000006, 4, 0.400000006)
  595. Gripweld = Instance.new("ManualWeld")
  596. Gripweld.Part0 = Handle Gripweld.Part1 = Grip Gripweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  597. Gripweld.C1 = CFrame.new(0.0500068665, 0.449998379, 5.96046448e-006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  598. Gripweld.Parent = Grip
  599. GripMesh = Instance.new("CylinderMesh",Grip)
  600. GripMesh.Name = "Mesh"
  601. GripMesh.Offset = Vector3.new(0, 0, 0)
  602. GripMesh.Scale = Vector3.new(1, 1, 1)
  603.  
  604. Down = Instance.new("WedgePart", game.Players.LocalPlayer.Character)
  605. Down:BreakJoints()
  606. Down.TopSurface = "Smooth"
  607. Down.Material = "SmoothPlastic"
  608. Down.Name = 'Down'
  609. Down.BottomSurface = "Smooth"
  610. Down.FormFactor = "Custom" Down.CanCollide = false
  611. Down.BrickColor = BrickColor.new("Toothpaste")
  612. Down.Size = Vector3.new(0.200000003, 1, 0.400000006)
  613. Downweld = Instance.new("ManualWeld")
  614. Downweld.Part0 = Handle Downweld.Part1 = Down Downweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  615. Downweld.C1 = CFrame.new(0.0500155687, -1.95003223, 0.19999814, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  616. Downweld.Parent = Down
  617. Connector = Instance.new("Part", game.Players.LocalPlayer.Character)
  618. Connector:BreakJoints()
  619. Connector.TopSurface = "Smooth"
  620. Connector.Material = "SmoothPlastic"
  621. Connector.Name = 'Connector'
  622. Connector.Shape="Ball"
  623. Connector.BottomSurface = "Smooth"
  624. Connector.FormFactor = "Custom" Connector.CanCollide = false
  625. Connector.BrickColor = BrickColor.new("Toothpaste")
  626. Connector.Size = Vector3.new(0.400000006, 0.400000006, 0.400000006)
  627. Connectorweld = Instance.new("ManualWeld")
  628. Connectorweld.Part0 = Handle Connectorweld.Part1 = Connector Connectorweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  629. Connectorweld.C1 = CFrame.new(0.0500068665, -1.55001354, 6.91413879e-006, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  630. Connectorweld.Parent = Connector
  631. Up = Instance.new("WedgePart", game.Players.LocalPlayer.Character)
  632. Up:BreakJoints()
  633. Up.TopSurface = "Smooth"
  634. Up.Material = "SmoothPlastic"
  635. Up.Name = 'Up'
  636. Up.BottomSurface = "Smooth"
  637. Up.FormFactor = "Custom" Up.CanCollide = false
  638. Up.BrickColor = BrickColor.new("Toothpaste")
  639. Up.Size = Vector3.new(0.200000003, 1, 0.400000006)
  640. Upweld = Instance.new("ManualWeld")
  641. Upweld.Part0 = Handle Upweld.Part1 = Up Upweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  642. Upweld.C1 = CFrame.new(-0.0500155687, -1.95002747, 0.200003147, -1, 0, 0, 0, 1, 0, -0, 0, -1)
  643. Upweld.Parent = Up
  644. Connector.Material="Neon"
  645. Grip.Material="Neon"
  646. Up.Material="Neon"
  647. Down.Material="Neon"
  648. end
  649. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement