Advertisement
Christoffer07700Extr

Lightsaber

Dec 31st, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.56 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,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84. local plrs = game:GetService("Players")
  85. local plr = owner
  86. local char = plr.Character
  87. local tweenserv = game:GetService("TweenService")
  88. local lighting = game:GetService("Lighting")
  89. local hum = char:FindFirstChildOfClass("Humanoid")
  90. local tor = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  91. local root = char:FindFirstChild("HumanoidRootPart")
  92. local head = char:FindFirstChild("Head")
  93. local face = head:FindFirstChildOfClass("Decal")
  94. local larm = char:FindFirstChild("Left Arm") or char:FindFirstChild("LeftUpperArm")
  95. local rarm = char:FindFirstChild("Right Arm") or char:FindFirstChild("RightUpperArm")
  96. local rleg = char:FindFirstChild("Right Leg") or char:FindFirstChild("RightUpperLeg")
  97. local lleg = char:FindFirstChild("Left Leg") or char:FindFirstChild("LeftUpperLeg")
  98. local neck = tor:FindFirstChild("Neck")
  99. local rootj = root:FindFirstChild("RootJoint")
  100. local LS = tor:FindFirstChild("Left Shoulder")
  101. local RS = tor:FindFirstChild("Right Shoulder")
  102. local LH = tor:FindFirstChild("Left Hip")
  103. local RH = tor:FindFirstChild("Right Hip")
  104. local bp = plr:FindFirstChild("Backpack")
  105. local cam = workspace.CurrentCamera
  106.  
  107. hum:ClearAllChildren()
  108. char.Animate:remove()
  109.  
  110.  
  111. --Converted with ttyyuu12345's model to script plugin v4
  112. function sandbox(var,func)
  113. local env = getfenv(func)
  114. local newenv = setmetatable({},{
  115. __index = function(self,k)
  116. if k=="script" then
  117. return var
  118. else
  119. return env[k]
  120. end
  121. end,
  122. })
  123. setfenv(func,newenv)
  124. return func
  125. end
  126. cors = {}
  127. mas = Instance.new("Model",game:GetService("Lighting"))
  128. Model0 = Instance.new("Model")
  129. Part1 = Instance.new("Part")
  130. ManualWeld2 = Instance.new("ManualWeld")
  131. Part3 = Instance.new("Part")
  132. Part4 = Instance.new("Part")
  133. ManualWeld5 = Instance.new("ManualWeld")
  134. Part6 = Instance.new("Part")
  135. ManualWeld7 = Instance.new("ManualWeld")
  136. Part8 = Instance.new("Part")
  137. ParticleEmitter9 = Instance.new("ParticleEmitter")
  138. ManualWeld10 = Instance.new("ManualWeld")
  139. Part11 = Instance.new("Part")
  140. ManualWeld12 = Instance.new("ManualWeld")
  141. Part19 = Instance.new("Part")
  142. ManualWeld20 = Instance.new("ManualWeld")
  143. Part21 = Instance.new("Part")
  144. ManualWeld22 = Instance.new("ManualWeld")
  145. Model0.Name = "saber"
  146. Model0.Parent = mas
  147. Part1.Name = "hand"
  148. Part1.Parent = Model0
  149. Part1.Material = Enum.Material.SmoothPlastic
  150. Part1.BrickColor = BrickColor.new("Really black")
  151. Part1.Rotation = Vector3.new(0, -90, 0)
  152. Part1.CanCollide = false
  153. Part1.Shape = Enum.PartType.Cylinder
  154. Part1.Size = Vector3.new(1.29999995, 0.299999952, 0.299999952)
  155. Part1.CFrame = CFrame.new(-1741.76343, 117.599991, -204.231796, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  156. Part1.BottomSurface = Enum.SurfaceType.Smooth
  157. Part1.TopSurface = Enum.SurfaceType.Smooth
  158. Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  159. Part1.Position = Vector3.new(-1741.76343, 117.599991, -204.231796)
  160. Part1.Orientation = Vector3.new(0, -90, 0)
  161. Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  162. ManualWeld2.Name = "Weld"
  163. ManualWeld2.Parent = Part1
  164. ManualWeld2.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  165. ManualWeld2.C1 = CFrame.new(0.0347900391, 0, 0.0680541992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  166. ManualWeld2.Part0 = Part1
  167. ManualWeld2.Part1 = Part3
  168. Part3.Name = "main"
  169. Part3.Parent = Model0
  170. Part3.Transparency = 1
  171. Part3.CanCollide = false
  172. Part3.Size = Vector3.new(1, 1, 1)
  173. Part3.CFrame = CFrame.new(-1741.79822, 117.599991, -204.29985, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  174. Part3.BottomSurface = Enum.SurfaceType.Smooth
  175. Part3.TopSurface = Enum.SurfaceType.Smooth
  176. Part3.Position = Vector3.new(-1741.79822, 117.599991, -204.29985)
  177. Part4.Name = "cap2"
  178. Part4.Parent = Model0
  179. Part4.Material = Enum.Material.SmoothPlastic
  180. Part4.BrickColor = BrickColor.new("Really black")
  181. Part4.Rotation = Vector3.new(0, -90, 0)
  182. Part4.CanCollide = false
  183. Part4.Shape = Enum.PartType.Cylinder
  184. Part4.Size = Vector3.new(0.0999999046, 0.349999994, 0.349999994)
  185. Part4.CFrame = CFrame.new(-1741.76343, 117.599991, -203.531723, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  186. Part4.BottomSurface = Enum.SurfaceType.Smooth
  187. Part4.TopSurface = Enum.SurfaceType.Smooth
  188. Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  189. Part4.Position = Vector3.new(-1741.76343, 117.599991, -203.531723)
  190. Part4.Orientation = Vector3.new(0, -90, 0)
  191. Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  192. ManualWeld5.Name = "Weld"
  193. ManualWeld5.Parent = Part4
  194. ManualWeld5.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  195. ManualWeld5.C1 = CFrame.new(0.0347900391, 0, 0.768127441, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  196. ManualWeld5.Part0 = Part4
  197. ManualWeld5.Part1 = Part3
  198. Part6.Name = "bot1"
  199. Part6.Parent = Model0
  200. Part6.Material = Enum.Material.SmoothPlastic
  201. Part6.BrickColor = BrickColor.new("Really black")
  202. Part6.Rotation = Vector3.new(0, -90, 0)
  203. Part6.CanCollide = false
  204. Part6.Shape = Enum.PartType.Cylinder
  205. Part6.Size = Vector3.new(0.0999999046, 0.349999994, 0.349999994)
  206. Part6.CFrame = CFrame.new(-1741.76343, 117.599991, -204.931747, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  207. Part6.BottomSurface = Enum.SurfaceType.Smooth
  208. Part6.TopSurface = Enum.SurfaceType.Smooth
  209. Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  210. Part6.Position = Vector3.new(-1741.76343, 117.599991, -204.931747)
  211. Part6.Orientation = Vector3.new(0, -90, 0)
  212. Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  213. ManualWeld7.Name = "Weld"
  214. ManualWeld7.Parent = Part6
  215. ManualWeld7.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  216. ManualWeld7.C1 = CFrame.new(0.0347900391, 0, -0.631896973, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  217. ManualWeld7.Part0 = Part6
  218. ManualWeld7.Part1 = Part3
  219. Part8.Name = "cap"
  220. Part8.Parent = Model0
  221. Part8.Material = Enum.Material.SmoothPlastic
  222. Part8.BrickColor = BrickColor.new("Gold")
  223. Part8.Rotation = Vector3.new(0, -90, 0)
  224. Part8.CanCollide = false
  225. Part8.Shape = Enum.PartType.Cylinder
  226. Part8.Size = Vector3.new(0.0999999046, 0.300000012, 0.300000012)
  227. Part8.CFrame = CFrame.new(-1741.76343, 117.599991, -203.431747, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  228. Part8.BottomSurface = Enum.SurfaceType.Smooth
  229. Part8.TopSurface = Enum.SurfaceType.Smooth
  230. Part8.Color = Color3.new(0.937255, 0.721569, 0.219608)
  231. Part8.Position = Vector3.new(-1741.76343, 117.599991, -203.431747)
  232. Part8.Orientation = Vector3.new(0, -90, 0)
  233. Part8.Color = Color3.new(0.937255, 0.721569, 0.219608)
  234. ParticleEmitter9.Parent = Part8
  235. ParticleEmitter9.LockedToPart = true
  236. ParticleEmitter9.Transparency = NumberSequence.new(0,0.1)
  237. ParticleEmitter9.Size = NumberSequence.new(0.5,0.5)
  238. ParticleEmitter9.Color = ColorSequence.new(Color3.new(0.333333, 0, 0),Color3.new(0.666667, 0, 0))
  239. ParticleEmitter9.EmissionDirection = "Right"
  240. ParticleEmitter9.LightEmission = 0.44999998807907
  241. ParticleEmitter9.Texture = "rbxassetid://147313514"
  242. ParticleEmitter9.Lifetime = NumberRange.new(0.5, 0.5)
  243. ParticleEmitter9.Rate = 200
  244. ParticleEmitter9.RotSpeed = NumberRange.new(360, 360)
  245. ParticleEmitter9.Speed = NumberRange.new(10, 10)
  246. ParticleEmitter9.VelocitySpread = 2
  247. ParticleEmitter9.Color = ColorSequence.new(Color3.new(0.333333, 0, 0),Color3.new(0.666667, 0, 0))
  248. ManualWeld10.Name = "Weld"
  249. ManualWeld10.Parent = Part8
  250. ManualWeld10.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  251. ManualWeld10.C1 = CFrame.new(0.0347900391, 0, 0.868103027, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  252. ManualWeld10.Part0 = Part8
  253. ManualWeld10.Part1 = Part3
  254. Part11.Name = "bot2"
  255. Part11.Parent = Model0
  256. Part11.Material = Enum.Material.SmoothPlastic
  257. Part11.BrickColor = BrickColor.new("Really black")
  258. Part11.Rotation = Vector3.new(0, -90, 0)
  259. Part11.CanCollide = false
  260. Part11.Shape = Enum.PartType.Cylinder
  261. Part11.Size = Vector3.new(0.0999999046, 0.300000012, 0.300000012)
  262. Part11.CFrame = CFrame.new(-1741.76343, 117.599991, -205.031723, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  263. Part11.BottomSurface = Enum.SurfaceType.Smooth
  264. Part11.TopSurface = Enum.SurfaceType.Smooth
  265. Part11.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  266. Part11.Position = Vector3.new(-1741.76343, 117.599991, -205.031723)
  267. Part11.Orientation = Vector3.new(0, -90, 0)
  268. Part11.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  269. ManualWeld12.Name = "Weld"
  270. ManualWeld12.Parent = Part11
  271. ManualWeld12.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  272. ManualWeld12.C1 = CFrame.new(0.0347900391, 0, -0.731872559, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  273. ManualWeld12.Part0 = Part11
  274. ManualWeld12.Part1 = Part3
  275. Part19.Name = "outblade"
  276. Part19.Parent = Model0
  277. Part19.Material = Enum.Material.Neon
  278. Part19.BrickColor = BrickColor.new("Maroon")
  279. Part19.Rotation = Vector3.new(0, -90, 0)
  280. Part19.CanCollide = false
  281. Part19.Shape = Enum.PartType.Cylinder
  282. Part19.Size = Vector3.new(4.39999962, 0.2500000012, 0.2500000012)
  283. Part19.CFrame = CFrame.new(-1741.76343, 117.599991, -201.181747, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  284. Part19.BottomSurface = Enum.SurfaceType.Smooth
  285. Part19.TopSurface = Enum.SurfaceType.Smooth
  286. Part19.Color = Color3.new(0.458824, 0, 0)
  287. Part19.Position = Vector3.new(-1741.76343, 117.599991, -201.181747)
  288. Part19.Orientation = Vector3.new(0, -90, 0)
  289. Part19.Color = Color3.new(0.458824, 0, 0)
  290. ManualWeld20.Name = "Weld"
  291. ManualWeld20.Parent = Part19
  292. ManualWeld20.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  293. ManualWeld20.C1 = CFrame.new(0.0347900391, 0, 3.11810303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  294. ManualWeld20.Part0 = Part19
  295. ManualWeld20.Part1 = Part3
  296. Part21.Name = "outball"
  297. Part21.Parent = Model0
  298. Part21.Material = Enum.Material.Neon
  299. Part21.BrickColor = BrickColor.new("Maroon")
  300. Part21.Rotation = Vector3.new(0, -90, 0)
  301. Part21.CanCollide = false
  302. Part21.Shape = Enum.PartType.Ball
  303. Part21.Size = Vector3.new(0.25, 0.25, 0.25)
  304. Part21.CFrame = CFrame.new(-1741.76343, 117.599991, -198.981674, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08)
  305. Part21.BottomSurface = Enum.SurfaceType.Smooth
  306. Part21.TopSurface = Enum.SurfaceType.Smooth
  307. Part21.Color = Color3.new(0.458824, 0, 0)
  308. Part21.Position = Vector3.new(-1741.76343, 117.599991, -198.981674)
  309. Part21.Orientation = Vector3.new(0, -90, 0)
  310. Part21.Color = Color3.new(0.458824, 0, 0)
  311. ManualWeld22.Name = "Weld"
  312. ManualWeld22.Parent = Part21
  313. ManualWeld22.C0 = CFrame.new(0, 0, 0, 1.19248806e-08, 0, 1, 0, 1, 0, -1, 0, 1.19248806e-08)
  314. ManualWeld22.C1 = CFrame.new(0.0347900391, 0, 5.31817627, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  315. ManualWeld22.Part0 = Part21
  316. ManualWeld22.Part1 = Part3
  317. for i,v in pairs(mas:GetChildren()) do
  318. v.Parent = char
  319. saber = v
  320. outblade = Part19
  321. outball = Part21
  322. particle = ParticleEmitter9
  323. main = Part3
  324. cap = Part8
  325. pcall(function() v:MakeJoints() end)
  326. end
  327. mas:Destroy()
  328. for i,v in pairs(cors) do
  329. spawn(function()
  330. pcall(v)
  331. end)
  332. end
  333.  
  334. local ws = hum.WalkSpeed
  335. local jp = hum.JumpPower
  336. local nws = ws
  337. local njp = jp
  338.  
  339. local rootj0 = rootj.C0
  340. local neck0 = neck.C0
  341. local LS0 = LS.C0
  342. local RS0 = RS.C0
  343. local LH0 = LH.C0
  344. local RH0 = RH.C0
  345. local rootj1 = rootj.C1
  346. local neck1 = neck.C1
  347. local LS1 = LS.C1
  348. local RS1 = RS.C1
  349. local LH1 = LH.C1
  350. local RH1 = RH.C1
  351.  
  352. local pshew = Instance.new("Sound", cap)
  353. pshew.SoundId = "rbxassetid://605604103"
  354. pshew.Volume = 2
  355. pshew.Name = "PSHEW"
  356.  
  357. local sheww = Instance.new("Sound", cap)
  358. sheww.SoundId = "rbxassetid://605607641"
  359. sheww.Volume = 2
  360. sheww.Name = "SHEWW"
  361.  
  362. local wanwan = Instance.new("Sound", outblade)
  363. wanwan.SoundId = "rbxassetid://1460966017"
  364. wanwan.Volume = 1
  365. wanwan.Name = "WANWAN"
  366. wanwan.Looped = true
  367.  
  368. local chwan = Instance.new("Sound", outblade)
  369. chwan.SoundId = "rbxassetid://1647165403"
  370. chwan.Volume = 1
  371. chwan.Name = "CHWAN"
  372.  
  373. local pssps = Instance.new("Sound", outblade)
  374. pssps.SoundId = "rbxassetid://1335649595"
  375. pssps.Volume = 1
  376. pssps.Name = "PSSPS"
  377.  
  378. local vomb = Instance.new("Sound", outblade)
  379. vomb.SoundId = "rbxassetid://2088308141"
  380. vomb.Volume = 2
  381. vomb.Name = "VOMB"
  382.  
  383. local ooowa = Instance.new("Sound", larm)
  384. ooowa.SoundId = "rbxassetid://1386781853"
  385. ooowa.Volume = 2.5
  386. ooowa.Name = "OOOWA"
  387.  
  388. local koohaa = Instance.new("Sound", head)
  389. koohaa.SoundId = "rbxassetid://"
  390. koohaa.Volume = 2
  391. koohaa.Name = "KOOOHAAA"
  392. koohaa.Looped = true
  393. koohaa:Play()
  394. local thepos = koohaa.TimePosition
  395.  
  396. -----------------------------------------------------------------------------
  397.  
  398. local CFn = CFrame.new
  399. local CFa = CFrame.Angles
  400. local Rad = math.rad
  401. local Cos = math.cos
  402. local Sin = math.sin
  403. local sine = 1
  404. local attacking = false
  405. local equipped = false
  406. local Changing = false
  407. local Swinging = false
  408. local kill = false
  409. local attackstate = 1
  410. local Choking = false
  411. local buttonC = false
  412.  
  413. -----------------------------------------------------------------------------
  414.  
  415.  
  416.  
  417. local ff = Instance.new("ForceField", char)
  418. ff.Visible = false
  419. hum.MaxHealth = math.huge
  420. hum.Health = math.huge
  421.  
  422. local AT0 = Instance.new("Attachment", outblade)
  423. AT0.Position = Vector3.new(-2.2, 0, 0)
  424.  
  425. local AT1 = Instance.new("Attachment", outblade)
  426. AT1.Position = Vector3.new(2.4, 0, 0)
  427.  
  428. local trail = Instance.new("Trail", outblade)
  429. trail.Attachment0 = AT0
  430. trail.Attachment1 = AT1
  431. trail.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0, 0), NumberSequenceKeypoint.new(1, 0.9, 0)})
  432. trail.LightEmission = 0.7
  433. trail.Lifetime = 0.5
  434. trail.MaxLength = 2
  435. trail.MinLength = 0.05
  436. trail.WidthScale = NumberSequence.new({NumberSequenceKeypoint.new(0, 1, 0), NumberSequenceKeypoint.new(1, 0.2, 0)})
  437. trail.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(85, 0, 0), 0), ColorSequenceKeypoint.new(1, Color3.fromRGB(170, 0, 0), 0)})
  438.  
  439. local mainw = Instance.new("Weld", main)
  440. mainw.Part0 = tor
  441. mainw.Part1 = main
  442. mainw.C1 = CFn(1, 1, 0)
  443.  
  444. local bld = Instance.new("Part", saber)
  445. bld.Size = Vector3.new(4.7, 1, 1)
  446. bld.CanCollide = false
  447. bld.Transparency = 1
  448.  
  449. local bldw = Instance.new("Weld", bld)
  450. bldw.Part0 = outblade
  451. bldw.Part1 = bld
  452.  
  453.  
  454. outblade.Transparency = 1
  455. outball.Transparency = 1
  456. trail.Enabled = false
  457. particle.Transparency = NumberSequence.new(0, 1)
  458. particle.LockedToPart = false
  459. particle.Enabled = false
  460.  
  461. -----------------------------------------------------------------------------
  462.  
  463. ArtificialHB = Instance.new("BindableEvent", script)
  464. ArtificialHB.Name = "Heartbeat"
  465. script:WaitForChild("Heartbeat")
  466.  
  467. frame = 1 / 60
  468. tf = 0
  469. allowframeloss = false
  470. tossremainder = false
  471.  
  472.  
  473. lastframe = tick()
  474. script.Heartbeat:Fire()
  475.  
  476.  
  477. game:GetService("RunService").Heartbeat:connect(function(s, p)
  478. tf = tf + s
  479. if tf >= frame then
  480. if allowframeloss then
  481. script.Heartbeat:Fire()
  482. lastframe = tick()
  483. else
  484. for i = 1, math.floor(tf / frame) do
  485. script.Heartbeat:Fire()
  486. end
  487. lastframe = tick()
  488. end
  489. if tossremainder then
  490. tf = 0
  491. else
  492. tf = tf - frame * math.floor(tf / frame)
  493. end
  494. end
  495. end)
  496.  
  497. function swait(num)
  498. if num == 0 or num == nil then
  499. game:service("RunService").Stepped:wait(0)
  500. else
  501. for i = 0, num do
  502. game:service("RunService").Stepped:wait(0)
  503. end
  504. end
  505. end
  506.  
  507. function clerp(a, b, t)
  508. return a:lerp(b, t)
  509. end
  510.  
  511. function Sound(id, vol, par, name, looped)
  512. if not par:FindFirstChild(name) then
  513. local sound = Instance.new("Sound", par)
  514. sound.SoundId = id
  515. sound.Volume = vol
  516. if looped == true then
  517. sound.Looped = true
  518. end
  519. sound.Name = name
  520. sound:Play()
  521. return sound
  522. else
  523. local sound = par:FindFirstChild(name)
  524. sound:Play()
  525. return sound
  526. end
  527. end
  528.  
  529. function StopSound(id, vol, par, name, looped)
  530. if not par:FindFirstChild(name) then
  531. local sound = Instance.new("Sound", par)
  532. sound.SoundId = id
  533. sound.Volume = vol
  534. if looped == true then
  535. sound.Looped = true
  536. end
  537. sound.Name = name
  538. sound:Stop()
  539. return sound
  540. else
  541. local sound = par:FindFirstChild(name)
  542. sound:Stop()
  543. return sound
  544. end
  545. end
  546.  
  547. function Force(part, pos, part2, pos2, par2)
  548. local parp = Instance.new("Part", char)
  549. parp.Size = Vector3.new(1, 1, 1)
  550. parp.Transparency = 1
  551. parp.CanCollide = false
  552. local parpw = Instance.new("Weld", parp)
  553. parpw.Part0 = part
  554. parpw.Part1 = parp
  555. parpw.C1 = pos
  556. local pare = Instance.new("ParticleEmitter", parp)
  557. pare.LockedToPart = true
  558. pare.Transparency = NumberSequence.new(0.4, 1)
  559. pare.Size = NumberSequence.new(1.25, 0)
  560. pare.Lifetime = NumberRange.new(1)
  561. pare.Rotation = NumberRange.new(0, 360)
  562. pare.Rate = 200
  563. pare.RotSpeed = NumberRange.new(360, 360)
  564. pare.Speed = NumberRange.new(4)
  565. pare.Color = ColorSequence.new(Color3.fromRGB(170, 0, 0),Color3.fromRGB(255, 255, 255))
  566. pare.SpreadAngle = Vector2.new(360, 360)
  567. pare.Texture = "rbxassetid://122356023"
  568. local parp2 = parp:Clone()
  569. parp2.Parent = par2
  570. local parp2w = parp2:FindFirstChild("Weld")
  571. parp2w.Part0 = part2
  572. parp2w.Part1 = parp2
  573. parp2w.C1 = pos2
  574. return parp, parp2
  575. end
  576.  
  577. function equipunequip()
  578. if attacking == false and equipped == false and Changing == false then
  579. attacking = true
  580. Changing = true
  581. hum.WalkSpeed = 0
  582. hum.JumpPower = 0
  583. for i = 0,1,.1 do
  584. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-20), 0, Rad(-60)), i)
  585. rootj.C1 = clerp(rootj.C1, rootj1, i)
  586. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  587. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(-30), Rad(-3)), i)
  588. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  589. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), 0, 0), i)
  590. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  591. rootj.C0 = clerp(rootj.C0, rootj0, i)
  592. LS.C0 = clerp(LS.C0, LS0, i)
  593. RS.C0 = clerp(RS.C0, RS0 * CFn(0, 0, -0.5) * CFa(0, Rad(90), 0), i)
  594. LH.C0 = clerp(LH.C0, LH0, i)
  595. RH.C0 = clerp(RH.C0, RH0, i)
  596. swait()
  597. end
  598. StopSound("rbxassetid://605607641", 2, cap, "SHEWW", false)
  599. Sound("rbxassetid://605604103", 2, cap, "PSHEW", false)
  600. Sound("rbxassetid://1460966017", 1, cap, "WANWAN", true)
  601. equipped = true
  602. mainw.Part0 = rarm
  603. mainw.C1 = CFn(0, 1, 0) * CFa(0, Rad(180), 0)
  604. outblade.Transparency = 0
  605. outball.Transparency = 0
  606. trail.Enabled = true
  607. particle.Transparency = NumberSequence.new(0, 0.1)
  608. particle.LockedToPart = true
  609. particle.Enabled = true
  610. for i = 0,1,.1 do
  611. neck.C1 = clerp(neck.C1, neck1, i)
  612. rootj.C1 = clerp(rootj.C1, rootj1, i)
  613. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  614. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(50), 0, 0), i)
  615. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  616. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), 0, 0), i)
  617. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  618. rootj.C0 = clerp(rootj.C0, rootj0, i)
  619. LS.C0 = clerp(LS.C0, LS0, i)
  620. RS.C0 = clerp(RS.C0, RS0, i)
  621. LH.C0 = clerp(LH.C0, LH0, i)
  622. RH.C0 = clerp(RH.C0, RH0, i)
  623. swait()
  624. end
  625. hum.WalkSpeed = nws
  626. hum.JumpPower = njp
  627. Changing = false
  628. attacking = false
  629. elseif attacking == false and equipped == true and Changing == false then
  630. attacking = true
  631. Changing = true
  632. hum.WalkSpeed = 0
  633. hum.JumpPower = 0
  634. StopSound("rbxassetid://605604103", 2, cap, "PSHEW", false)
  635. Sound("rbxassetid://605607641", 2, cap, "SHEWW", false)
  636. StopSound("rbxassetid://1460966017", 1, cap, "WANWAN", true)
  637. outblade.Transparency = 1
  638. outball.Transparency = 1
  639. trail.Enabled = false
  640. particle.Transparency = NumberSequence.new(0, 1)
  641. particle.LockedToPart = false
  642. particle.Enabled = false
  643. for i = 0,1,.1 do
  644. neck.C1 = clerp(neck.C1, neck1, i)
  645. rootj.C1 = clerp(rootj.C1, rootj1, i)
  646. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  647. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(50), 0, 0), i)
  648. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  649. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), 0, 0), i)
  650. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  651. rootj.C0 = clerp(rootj.C0, rootj0, i)
  652. LS.C0 = clerp(LS.C0, LS0, i)
  653. RS.C0 = clerp(RS.C0, RS0, i)
  654. LH.C0 = clerp(LH.C0, LH0, i)
  655. RH.C0 = clerp(RH.C0, RH0, i)
  656. swait()
  657. end
  658. for i = 0,1,.1 do
  659. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-20), 0, Rad(-60)), i)
  660. rootj.C1 = clerp(rootj.C1, rootj1, i)
  661. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  662. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(-30), Rad(-3)), i)
  663. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  664. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), 0, 0), i)
  665. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  666. rootj.C0 = clerp(rootj.C0, rootj0, i)
  667. LS.C0 = clerp(LS.C0, LS0, i)
  668. RS.C0 = clerp(RS.C0, RS0 * CFn(0, 0, -0.5) * CFa(0, Rad(90), 0), i)
  669. LH.C0 = clerp(LH.C0, LH0, i)
  670. RH.C0 = clerp(RH.C0, RH0, i)
  671. swait()
  672. end
  673. mainw.Part0 = tor
  674. mainw.C1 = CFn(1, 1, 0)
  675. equipped = false
  676. hum.WalkSpeed = nws
  677. hum.JumpPower = njp
  678. Changing = false
  679. attacking = false
  680. end
  681. end
  682.  
  683. function Swing()
  684. if attacking == false and equipped == true and Swinging == false then
  685. attacking = true
  686. Swinging = true
  687. kill = true
  688. hum.WalkSpeed = 3
  689. hum.JumpPower = 5
  690. local hey = bld.Touched:connect(function(hit)
  691. if kill == true and hit.Parent:FindFirstChildOfClass("Humanoid") and not hit:IsDescendantOf(char) then
  692. kill = false
  693. local killman = hit.Parent
  694. local killhum = killman:FindFirstChildOfClass("Humanoid")
  695. local up = true
  696. for i = 1,2 do
  697. local cutpart = Instance.new("Part", killman)
  698. cutpart.Size = Vector3.new(hit.Size.X, hit.Size.Y / 2, hit.Size.Z)
  699. cutpart.BrickColor = hit.BrickColor
  700. cutpart.Material = hit.Material
  701. cutpart.Transparency = hit.Transparency
  702. cutpart.Reflectance = hit.Reflectance
  703. cutpart.BackSurface = hit.BackSurface
  704. cutpart.BottomSurface = hit.BottomSurface
  705. cutpart.FrontSurface = hit.FrontSurface
  706. cutpart.LeftSurface = hit.LeftSurface
  707. cutpart.RightSurface = hit.RightSurface
  708. cutpart.TopSurface = hit.TopSurface
  709. if up == true then
  710. cutpart.CFrame = hit.CFrame * CFn(0, hit.Size.Y / 2, 0)
  711. up = false
  712. else
  713. cutpart.CFrame = hit.CFrame * CFn(0, -(hit.Size.Y / 2), 0)
  714. up = true
  715. end
  716. end
  717. hit:Destroy()
  718. killman:BreakJoints()
  719. if attackstate == 1 then
  720. Sound("rbxassetid://1647165403", 1, outblade, "CHWAN", false)
  721. elseif attackstate == 2 then
  722. Sound("rbxassetid://1335649595", 1, outblade, "PSSPS", false)
  723. end
  724. elseif kill == true and hit.Parent.Parent:FindFirstChildOfClass("Humanoid") and not hit:IsDescendantOf(char) then
  725. kill = false
  726. local killman = hit.Parent.Parent
  727. local killhum = killman:FindFirstChildOfClass("Humanoid")
  728. local up = true
  729. for i = 1,2 do
  730. local cutpart = Instance.new("Part", killman)
  731. cutpart.Size = Vector3.new(hit.Size.X, hit.Size.Y / 2, hit.Size.Z)
  732. cutpart.BrickColor = hit.BrickColor
  733. cutpart.Material = hit.Material
  734. cutpart.Transparency = hit.Transparency
  735. cutpart.Reflectance = hit.Reflectance
  736. cutpart.BackSurface = hit.BackSurface
  737. cutpart.BottomSurface = hit.BottomSurface
  738. cutpart.FrontSurface = hit.FrontSurface
  739. cutpart.LeftSurface = hit.LeftSurface
  740. cutpart.RightSurface = hit.RightSurface
  741. cutpart.TopSurface = hit.TopSurface
  742. if up == true then
  743. cutpart.CFrame = hit.CFrame * CFn(0, hit.Size.Y / 2, 0)
  744. up = false
  745. else
  746. cutpart.CFrame = hit.CFrame * CFn(0, -(hit.Size.Y / 2), 0)
  747. up = true
  748. end
  749. end
  750. hit:Destroy()
  751. killman:BreakJoints()
  752. if attackstate == 1 then
  753. Sound("rbxassetid://1647165403", 1, outblade, "CHWAN", false)
  754. elseif attackstate == 2 then
  755. Sound("rbxassetid://1335649595", 1, outblade, "PSSPS", false)
  756. end
  757. end
  758. end)
  759. if attackstate == 1 then
  760. attackstate = 2
  761. for i = 0,1,.15 do
  762. neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, Rad(-10)), i)
  763. rootj.C1 = clerp(rootj.C1, rootj1, i)
  764. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  765. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(-80), Rad(-40)), i)
  766. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  767. RH.C1 = clerp(RH.C1, RH1 * CFn(0.3, 0, 0) * CFa(Rad(5), 0, 0), i)
  768. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  769. rootj.C0 = clerp(rootj.C0, rootj0, i)
  770. LS.C0 = clerp(LS.C0, LS0, i)
  771. RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(30), 0), i)
  772. LH.C0 = clerp(LH.C0, LH0, i)
  773. RH.C0 = clerp(RH.C0, RH0, i)
  774. swait()
  775. end
  776. Sound("rbxassetid://2088308141", 2, outblade, "VOMB", false)
  777. for i = 0,1,.15 do
  778. neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, Rad(10)), i)
  779. rootj.C1 = clerp(rootj.C1, rootj1, i)
  780. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  781. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(30), Rad(-80), Rad(-50)), i)
  782. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  783. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), 0, 0), i)
  784. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  785. rootj.C0 = clerp(rootj.C0, rootj0, i)
  786. LS.C0 = clerp(LS.C0, LS0, i)
  787. RS.C0 = clerp(RS.C0, RS0 * CFa(0, Rad(-75), 0), i)
  788. LH.C0 = clerp(LH.C0, LH0, i)
  789. RH.C0 = clerp(RH.C0, RH0, i)
  790. swait()
  791. end
  792. elseif attackstate == 2 then
  793. attackstate = 1
  794. for i = 0,1,.15 do
  795. neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, Rad(10)), i)
  796. rootj.C1 = clerp(rootj.C1, rootj1, i)
  797. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  798. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(110), Rad(-20), Rad(-90)), i)
  799. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  800. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), 0, 0), i)
  801. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  802. rootj.C0 = clerp(rootj.C0, rootj0, i)
  803. LS.C0 = clerp(LS.C0, LS0, i)
  804. RS.C0 = clerp(RS.C0, RS0, i)
  805. LH.C0 = clerp(LH.C0, LH0, i)
  806. RH.C0 = clerp(RH.C0, RH0, i)
  807. swait()
  808. end
  809. Sound("rbxassetid://2088308141", 2, outblade, "VOMB", false)
  810. for i = 0,1,.15 do
  811. neck.C1 = clerp(neck.C1, neck1 * CFa(0, 0, Rad(-10)), i)
  812. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(0, 0, Rad(-40)), i)
  813. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), i)
  814. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(-80), Rad(70), Rad(-40)), i)
  815. LH.C1 = clerp(LH.C1, LH1 * CFa(Rad(5), 0, 0), i)
  816. RH.C1 = clerp(RH.C1, RH1 * CFa(Rad(5), Rad(40), 0), i)
  817. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), i)
  818. rootj.C0 = clerp(rootj.C0, rootj0, i)
  819. LS.C0 = clerp(LS.C0, LS0, i)
  820. RS.C0 = clerp(RS.C0, RS0, i)
  821. LH.C0 = clerp(LH.C0, LH0, i)
  822. RH.C0 = clerp(RH.C0, RH0, i)
  823. swait()
  824. end
  825. end
  826. hum.WalkSpeed = nws
  827. hum.JumpPower = njp
  828. kill = false
  829. hey:disconnect()
  830. Swinging = false
  831. attacking = false
  832. end
  833. end
  834.  
  835.  
  836.  
  837. -----------------------------------------------------------------------------
  838.  
  839. function kdown(k)
  840. if k == "e" then
  841. equipunequip()
  842. elseif k == "c" then
  843. if buttonC == false then
  844. buttonC = true
  845. Nothing()
  846. end
  847. end
  848. end
  849.  
  850. function kup(k)
  851. if k == "c" then
  852. if buttonC == true then
  853. buttonC = false
  854. end
  855. end
  856. end
  857.  
  858. function lmdown()
  859. Swing()
  860. end
  861.  
  862. Mouse.KeyDown:connect(kdown)
  863. Mouse.KeyUp:connect(kup)
  864. Mouse.Button1Down:connect(lmdown)
  865.  
  866. -----------------------------------------------------------------------------
  867.  
  868. warn([[Darth Vader.
  869. last updated: 2018/7/19, 20:14 JST.
  870.  
  871. Please do not leak this script.]])
  872.  
  873. -----------------------------------------------------------------------------
  874.  
  875. while true do
  876. swait()
  877. sine = sine + 1
  878. local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
  879. if Changing == true then
  880. state = "Change"
  881. elseif Swinging == true then
  882. state = "Swing"
  883. elseif Choking == true then
  884. state = "Choking"
  885. elseif 1 < root.Velocity.y then
  886. state = "Jump"
  887. elseif -1 > root.Velocity.y then
  888. state = "Fall"
  889. elseif torvel < 1 then
  890. state = "Idle"
  891. elseif tor.Velocity.magnitude < 50 then
  892. state = "Walk"
  893. end
  894.  
  895. if state == "Jump" then
  896. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-10), 0, 0), 0.15)
  897. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(-10), 0, 0), 0.15)
  898. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), 0.15)
  899. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(10), 0, 0), 0.15)
  900. LH.C1 = clerp(LH.C1, LH1 * CFn(0.5, -1, -0.1) * CFa(Rad(-10), 0, Rad(-40)), 0.15)
  901. RH.C1 = clerp(RH.C1, RH1 * CFn(-0.3, -0.8, 0) * CFa(Rad(-5), 0, Rad(15)), 0.15)
  902. neck.C0 = clerp(neck.C0, neck0, 0.15)
  903. rootj.C0 = clerp(rootj.C0, rootj0, 0.15)
  904. LS.C0 = clerp(LS.C0, LS0, 0.15)
  905. RS.C0 = clerp(RS.C0, RS0, 0.15)
  906. LH.C0 = clerp(LH.C0, LH0, 0.15)
  907. RH.C0 = clerp(RH.C0, RH0, 0.15)
  908. elseif state == "Fall" then
  909. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-5), 0, 0), 0.15)
  910. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(10), 0, 0), 0.15)
  911. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(20), 0, 0), 0.15)
  912. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(20), 0, 0), 0.15)
  913. LH.C1 = clerp(LH.C1, LH1 * CFn(0.1, -0.4, -0.1) * CFa(Rad(-2), 0, 0), 0.15)
  914. RH.C1 = clerp(RH.C1, RH1 * CFn(-0.1, -0.4, -0.1) * CFa(Rad(-2), 0, 0), 0.15)
  915. neck.C0 = clerp(neck.C0, neck0, 0.15)
  916. rootj.C0 = clerp(rootj.C0, rootj0, 0.15)
  917. LS.C0 = clerp(LS.C0, LS0, 0.15)
  918. RS.C0 = clerp(RS.C0, RS0, 0.15)
  919. LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(20)), 0.15)
  920. RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(-20)), 0.15)
  921. elseif state == "Idle" then
  922. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-7 * Sin(sine / 15)), 0, 0), 0.15)
  923. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.1 * Cos(sine / 15)) * CFa(Rad(-2 * Sin(sine / 15)), 0, 0), 0.15)
  924. LS.C1 = clerp(LS.C1, LS1 * CFn(0, 0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, 0), 0.15)
  925. RS.C1 = clerp(RS.C1, RS1 * CFn(0, 0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, 0), 0.15)
  926. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, Rad(2 * Sin(sine / 15))), 0.15)
  927. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, Rad(-2 * Sin(sine / 15))), 0.15)
  928. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(10), 0, 0), 0.15)
  929. rootj.C0 = clerp(rootj.C0, rootj0 * CFa(Rad(2), 0, 0), 0.15)
  930. LS.C0 = clerp(LS.C0, LS0, 0.15)
  931. RS.C0 = clerp(RS.C0, RS0, 0.15)
  932. LH.C0 = clerp(LH.C0, LH0, 0.15)
  933. RH.C0 = clerp(RH.C0, RH0, 0.15)
  934. elseif state == "Walk" then
  935. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-5 * Sin(sine / 4)), 0, 0), 0.15)
  936. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.1 * Cos(sine / 4)) * CFa(Rad(-5), 0, Rad(5 * Sin(sine / 8))), 0.15)
  937. LS.C1 = clerp(LS.C1, LS1 * CFa(0, 0, Rad(-25 * Sin(sine / 8))), 0.15)
  938. RS.C1 = clerp(RS.C1, RS1 * CFa(0, 0, Rad(-25 * Sin(sine / 8))), 0.15)
  939. LH.C1 = clerp(LH.C1, LH1 * CFn(0.15 * Cos(sine / 8), -0.3 * Cos(sine / 8), 0) * CFa(0, 0, Rad(55 * Sin(sine / 8))), 0.15)
  940. RH.C1 = clerp(RH.C1, RH1 * CFn(0.15 * Cos(sine / 8), 0.3 * Cos(sine / 8), 0) * CFa(0, 0, Rad(55 * Sin(sine / 8))), 0.15)
  941. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), 0.15)
  942. rootj.C0 = clerp(rootj.C0, rootj0, 0.15)
  943. LS.C0 = clerp(LS.C0, LS0, 0.15)
  944. RS.C0 = clerp(RS.C0, RS0, 0.15)
  945. LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(20)), 0.15)
  946. RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(-20)), 0.15)
  947. end
  948. if not head:FindFirstChild("KOOOHAAA") then
  949. koohaa = Instance.new("Sound", head)
  950. koohaa.SoundId = "rbxassetid://149840174"
  951. koohaa.Name = "KOOOHAAA"
  952. koohaa.Volume = 2
  953. koohaa.TimePosition = thepos
  954. koohaa.Looped = true
  955. koohaa:Play()
  956. end
  957. thepos = koohaa.TimePosition
  958. end
  959. -----------------------------------------------------------------------------
  960.  
  961. while true do
  962. swait()
  963. sine = sine + 1
  964. local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
  965. if Changing == true then
  966. state = "Change"
  967. elseif Swinging == true then
  968. state = "Swing"
  969. elseif Choking == true then
  970. state = "Choking"
  971. elseif 1 < root.Velocity.y then
  972. state = "Jump"
  973. elseif -1 > root.Velocity.y then
  974. state = "Fall"
  975. elseif torvel < 1 then
  976. state = "Idle"
  977. elseif tor.Velocity.magnitude < 50 then
  978. state = "Walk"
  979. end
  980.  
  981. if state == "Jump" then
  982. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-10), 0, 0), 0.15)
  983. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(-10), 0, 0), 0.15)
  984. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(10), 0, 0), 0.15)
  985. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(10), 0, 0), 0.15)
  986. LH.C1 = clerp(LH.C1, LH1 * CFn(0.5, -1, -0.1) * CFa(Rad(-10), 0, Rad(-40)), 0.15)
  987. RH.C1 = clerp(RH.C1, RH1 * CFn(-0.3, -0.8, 0) * CFa(Rad(-5), 0, Rad(15)), 0.15)
  988. neck.C0 = clerp(neck.C0, neck0, 0.15)
  989. rootj.C0 = clerp(rootj.C0, rootj0, 0.15)
  990. LS.C0 = clerp(LS.C0, LS0, 0.15)
  991. RS.C0 = clerp(RS.C0, RS0, 0.15)
  992. LH.C0 = clerp(LH.C0, LH0, 0.15)
  993. RH.C0 = clerp(RH.C0, RH0, 0.15)
  994. elseif state == "Fall" then
  995. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-5), 0, 0), 0.15)
  996. rootj.C1 = clerp(rootj.C1, rootj1 * CFa(Rad(10), 0, 0), 0.15)
  997. LS.C1 = clerp(LS.C1, LS1 * CFa(Rad(20), 0, 0), 0.15)
  998. RS.C1 = clerp(RS.C1, RS1 * CFa(Rad(20), 0, 0), 0.15)
  999. LH.C1 = clerp(LH.C1, LH1 * CFn(0.1, -0.4, -0.1) * CFa(Rad(-2), 0, 0), 0.15)
  1000. RH.C1 = clerp(RH.C1, RH1 * CFn(-0.1, -0.4, -0.1) * CFa(Rad(-2), 0, 0), 0.15)
  1001. neck.C0 = clerp(neck.C0, neck0, 0.15)
  1002. rootj.C0 = clerp(rootj.C0, rootj0, 0.15)
  1003. LS.C0 = clerp(LS.C0, LS0, 0.15)
  1004. RS.C0 = clerp(RS.C0, RS0, 0.15)
  1005. LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(20)), 0.15)
  1006. RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(-20)), 0.15)
  1007. elseif state == "Idle" then
  1008. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-7 * Sin(sine / 15)), 0, 0), 0.15)
  1009. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.1 * Cos(sine / 15)) * CFa(Rad(-2 * Sin(sine / 15)), 0, 0), 0.15)
  1010. LS.C1 = clerp(LS.C1, LS1 * CFn(0, 0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, 0), 0.15)
  1011. RS.C1 = clerp(RS.C1, RS1 * CFn(0, 0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, 0), 0.15)
  1012. LH.C1 = clerp(LH.C1, LH1 * CFn(0, -0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, Rad(2 * Sin(sine / 15))), 0.15)
  1013. RH.C1 = clerp(RH.C1, RH1 * CFn(0, -0.1 * Cos(sine / 15), 0) * CFa(Rad(5), 0, Rad(-2 * Sin(sine / 15))), 0.15)
  1014. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(10), 0, 0), 0.15)
  1015. rootj.C0 = clerp(rootj.C0, rootj0 * CFa(Rad(2), 0, 0), 0.15)
  1016. LS.C0 = clerp(LS.C0, LS0, 0.15)
  1017. RS.C0 = clerp(RS.C0, RS0, 0.15)
  1018. LH.C0 = clerp(LH.C0, LH0, 0.15)
  1019. RH.C0 = clerp(RH.C0, RH0, 0.15)
  1020. elseif state == "Walk" then
  1021. neck.C1 = clerp(neck.C1, neck1 * CFa(Rad(-5 * Sin(sine / 4)), 0, 0), 0.15)
  1022. rootj.C1 = clerp(rootj.C1, rootj1 * CFn(0, 0, 0.1 * Cos(sine / 4)) * CFa(Rad(-5), 0, Rad(5 * Sin(sine / 8))), 0.15)
  1023. LS.C1 = clerp(LS.C1, LS1 * CFa(0, 0, Rad(-25 * Sin(sine / 8))), 0.15)
  1024. RS.C1 = clerp(RS.C1, RS1 * CFa(0, 0, Rad(-25 * Sin(sine / 8))), 0.15)
  1025. LH.C1 = clerp(LH.C1, LH1 * CFn(0.15 * Cos(sine / 8), -0.3 * Cos(sine / 8), 0) * CFa(0, 0, Rad(55 * Sin(sine / 8))), 0.15)
  1026. RH.C1 = clerp(RH.C1, RH1 * CFn(0.15 * Cos(sine / 8), 0.3 * Cos(sine / 8), 0) * CFa(0, 0, Rad(55 * Sin(sine / 8))), 0.15)
  1027. neck.C0 = clerp(neck.C0, neck0 * CFa(Rad(5), 0, 0), 0.15)
  1028. rootj.C0 = clerp(rootj.C0, rootj0, 0.15)
  1029. LS.C0 = clerp(LS.C0, LS0, 0.15)
  1030. RS.C0 = clerp(RS.C0, RS0, 0.15)
  1031. LH.C0 = clerp(LH.C0, LH0 * CFa(0, 0, Rad(20)), 0.15)
  1032. RH.C0 = clerp(RH.C0, RH0 * CFa(0, 0, Rad(-20)), 0.15)
  1033. end
  1034. if not head:FindFirstChild("KOOOHAAA") then
  1035. koohaa = Instance.new("Sound", head)
  1036. koohaa.SoundId = "rbxassetid://"
  1037. koohaa.Name = "KOOOHAAA"
  1038. koohaa.Volume = 2
  1039. koohaa.TimePosition = thepos
  1040. koohaa.Looped = true
  1041. koohaa:Play()
  1042. end
  1043. thepos = koohaa.TimePosition
  1044. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement