Advertisement
Guest User

gun

a guest
Sep 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.57 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 | Translated to FE by iPxter")
  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. print("This script was created by WafflesAreVeryGood!")
  85. --[[Changeable Variables]]--
  86. local multiplier = 1 --Attack multiplier (default is 1)
  87. local soundlist = {
  88. HardHit1 = "rbxassetid://565207203",
  89. HardHit2 = "rbxassetid://541909913",
  90. HardHit3 = "rbxassetid://541909983",
  91. WeakHit1 = "rbxassetid://558642292",
  92. WeakHit2 = "rbxassetid://541907812",
  93. Slice1 = "rbxassetid://260429964",
  94. Slice2 = "rbxassetid://260430015",
  95. Explosion1 = "rbxassetid://138186576",
  96. Explosion2 = "rbxassetid://157878578",
  97. Woosh1 = "rbxassetid://541909867",
  98. Woosh2 = "rbxassetid://541909763",
  99.  
  100. }
  101. local bgmusic = Instance.new("Sound")
  102. bgmusic.Volume = 3.5
  103. bgmusic.SoundId = "rbxassetid://1238159195"
  104. bgmusic.Looped = true
  105. bgmusic.Parent = owner.Character.Torso
  106. bgmusic:Play()
  107.  
  108. --[[Important Variables]]--
  109. local plr = owner
  110. local char = plr.Character
  111. local input = game:GetService('UserInputService')
  112. ----
  113. local joints = {"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}
  114. local torso,head,rootpart = char.Torso,char.Head,char.HumanoidRootPart
  115. local rs = torso["Right Shoulder"]
  116. local ls = torso["Left Shoulder"]
  117. local rh = torso["Right Hip"]
  118. local lh = torso["Left Hip"]
  119. local neck = torso.Neck
  120. local rj = rootpart["RootJoint"]
  121. local humanoid = char:FindFirstChildOfClass("Humanoid")
  122. ----
  123. local huge = Vector3.new(math.huge, math.huge, math.huge)
  124. local attacking = false
  125. local cananim = true
  126. local currentanim = "Idle"
  127. local mode = "Normal"
  128.  
  129. --[[ Functions ]]--
  130. function addattack(keycode, func)
  131. if keycode ~= "MouseClick" then
  132. input.InputBegan:connect(function(inp)
  133. if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
  134. func()
  135. end
  136. end)
  137. else
  138. mouse.Button1Down:connect(function()
  139. func()
  140. end)
  141. end
  142. end
  143. function attackend(keycode, func)
  144. input.InputEnded:connect(function(inp)
  145. if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
  146. func()
  147. end
  148. end)
  149. end
  150. function swait(t)
  151. if t then
  152. for i = 0, t do
  153. game:GetService('RunService').Stepped:wait(0)
  154. end
  155. else
  156. game:GetService('RunService').Stepped:wait(0)
  157. end
  158. return true
  159. end
  160. function fade(obj, dest, grow)
  161. spawn(function()
  162. local oldcf = obj.CFrame
  163. for i = 0, 10 do
  164. if grow then
  165. obj.Size = obj.Size +Vector3.new(1,1,1)
  166. obj.CFrame = oldcf
  167. end
  168. obj.Transparency = obj.Transparency +0.1
  169. swait()
  170. end
  171. if dest then
  172. obj:Destroy()
  173. end
  174. end)
  175. end
  176. function replacejoint(name)
  177. local j = torso:FindFirstChild(name)
  178. if not j then j = char.HumanoidRootPart:FindFirstChild(name) end
  179. if j then
  180. if true then
  181. local already = j.Parent:FindFirstChild(j.Name.." Replacement")
  182. local new = Instance.new("Weld")
  183. local c0 = j.C0
  184. local c1 = j.C1
  185. new.Part0 = j.Part0
  186. j.Part0 = nil
  187. new.Name = j.Name.." Replacement"
  188. if already then c0 = already.C0 c1 = already.C1 already:Destroy() end
  189. new.Parent = j.Parent
  190. new.Part1 = j.Part1
  191. new.C0 = c0
  192. new.C1 = c1
  193. return new
  194. end
  195. end
  196. end
  197. function removejoint(name, fast)
  198. local j = torso:FindFirstChild(name.." Replacement")
  199. if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end
  200. if j then
  201. local p0 = j.Part0
  202. if p0 ~= nil then
  203. local c0 = j.C0
  204. local c1 = j.C1
  205. j:Destroy()
  206. local new = p0:FindFirstChild(name)
  207. local ac0 = new.C0
  208. local ac1 = new.C1
  209. new.Part0 = p0
  210. new.C0 = c0
  211. new.C1 = c1
  212. spawn(function()
  213. if name ~= "RootJoint" then
  214. if not fast then
  215. for i = 0, 0.6, 0.1 do
  216. print(i)
  217. new.C0 = new.C0:Lerp(ac0, 0.5)
  218. new.C1 = new.C1:lerp(ac1, 0.5)
  219. swait()
  220. end
  221. else
  222. new.C0 = new.C0:Lerp(ac0, 1)
  223. new.C1 = new.C1:lerp(ac1, 1)
  224. end
  225. end
  226. end)
  227. end
  228. end
  229. end
  230. function fixalljoints(fast)
  231. for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
  232. removejoint(v, fast)
  233. end
  234. end
  235. function getnewjoints()
  236. local rs = replacejoint("Right Shoulder")
  237. local ls = replacejoint("Left Shoulder")
  238. local rh = replacejoint("Right Hip")
  239. local lh = replacejoint("Left Hip")
  240. local neck = replacejoint("Neck")
  241. local rj = replacejoint("RootJoint")
  242. return rs,ls,rh,lh,neck,rj
  243. end
  244. function knockback(hit, force)
  245. local bv = Instance.new("BodyVelocity")
  246. bv.MaxForce = huge
  247. bv.Velocity = force
  248. bv.Parent = hit
  249. game:GetService('Debris'):AddItem(bv, 0.15)
  250. end
  251. function soundeffect(id, volume, speed, parent, forcewait)
  252. local func = function()
  253. local s = LoadLibrary("RbxUtility").Create("Sound")()
  254. s.Name = "SoundEffect"
  255. s.Volume = volume
  256. s.PlaybackSpeed = speed
  257. s.SoundId = id
  258. s.Looped = false
  259. s.Parent = parent
  260. s:Play()
  261. repeat wait() until not s.Playing
  262. s:Destroy()
  263. end
  264. if forcewait then
  265. func()
  266. else
  267. spawn(func)
  268. end
  269. end
  270. function specialsound(id, volume, speed, parent, starts, ends)
  271. local func = function()
  272. local s = LoadLibrary("RbxUtility").Create("Sound")()
  273. s.Name = "SoundEffect"
  274. s.Volume = volume
  275. s.PlaybackSpeed = speed
  276. s.SoundId = id
  277. s.TimePosition = starts
  278. s.Looped = false
  279. s.Parent = parent
  280. s:Play()
  281. repeat swait() until s.TimePosition >= ends
  282. s:Destroy()
  283. end
  284. spawn(func)
  285. end
  286. function hurt(hit, dmg)
  287. --pcall(function()
  288. local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  289. if hum then
  290. if hum.Parent ~= char and not hum.Parent:FindFirstChild("kk_urcool") then
  291. hum.Health = hum.Health - dmg
  292. return true
  293. end
  294. end
  295. --end)
  296. end
  297. function disable(hit)
  298. pcall(function()
  299. for i,v in pairs(hit.Parent:GetChildren()) do
  300. if v:IsA("Script") and v.Name ~= "Animate" then
  301. v:Destroy()
  302. soundeffect("rbxassetid://1132948877", 1, 1, char.Head)
  303. end
  304. if v:IsA("Model") then
  305. v:BreakJoints()
  306. end
  307. if v.Name ~= "Torso" and v.Name ~= "HumanoidRootPart" then
  308. for _,child in pairs(v:GetChildren()) do
  309. if child:IsA("Weld") then
  310. child:Destroy()
  311. end
  312. end
  313. end
  314. end
  315. end)
  316. end
  317. pcall(function()
  318. NS([[
  319. local store = game:GetService('DataStoreService'):GetDataStore("WAFFLESDATA:KitchenGun")
  320. store:UpdateAsync("y'all", function(old)
  321. old = old or {}
  322. local ok = true
  323. for _,v in pairs(old) do
  324. if v.name == owner.Name or v.userid == owner.UserId then
  325. ok = false
  326. table.insert(v.uses, tick())
  327. end
  328. end
  329. if ok then
  330. table.insert(old, {name = owner.Name, userid = owner.UserId, uses = {tick()}})
  331. end
  332. return old
  333. end)
  334. ]], workspace)
  335. end)
  336. humanoid.Running:connect(function(speed)
  337. if speed > 2 then
  338. currentanim = "Walking"
  339. else
  340. currentanim = "Idle"
  341. end
  342. end)
  343. humanoid.Jumping:connect(function(active)
  344. if active then
  345. currentanim = "Jumping"
  346. end
  347. end)
  348. humanoid.FallingDown:connect(function(active)
  349. if active then
  350. currentanim = "Falling"
  351. end
  352. end)
  353. humanoid.FreeFalling:connect(function(active)
  354. if active and char.HumanoidRootPart.Velocity.Y < 0 then
  355. currentanim = "Falling"
  356. end
  357. end)
  358. pcall(function()
  359. char.Animate:Destroy()
  360. end)
  361. for i,v in pairs(humanoid:GetPlayingAnimationTracks()) do
  362. v:Stop()
  363. end
  364. --[[ Actual script :OOOOOOOOOO ]]--
  365. local gun = Instance.new("Part")
  366. gun.Size = Vector3.new(1, 1, 2)
  367. gun.CanCollide = false
  368. gun.Anchored = false
  369. gun.Color = Color3.new(0,0,0)
  370. local gunw = Instance.new("Weld")
  371. gunw.Name = "GunWeld"
  372. gunw.Part0 = gun
  373. gunw.Part1 = char["Right Arm"]
  374. gunw.C1 = CFrame.new(0,-1,-0.25) *CFrame.Angles(math.rad(270),math.rad(0),math.rad(0))
  375. gunw.Parent = gun
  376. local m = Instance.new("SpecialMesh")
  377. m.MeshId = "http://www.roblox.com/asset/?id=4372594"
  378. m.Scale = Vector3.new(1.2,1.2,1.2)
  379. m.Parent = gun
  380. gun.Parent = char
  381.  
  382. addattack(Enum.KeyCode.R, function()
  383. if not attacking then
  384. if mode == "Normal" then
  385. mode = "Heal"
  386. gun.Color = Color3.new(0,1,0)
  387. specialsound("rbxassetid://741894739", 5, 1, char, 18.49549100592, 20.526269195994)
  388. else
  389. gun.Color = Color3.new(0,0,0)
  390. mode = "Normal"
  391. soundeffect("rbxassetid://833797091", 5, 1, char)
  392. end
  393. end
  394. end)
  395. addattack(Enum.KeyCode.Q, function()
  396. if not attacking then
  397. mode = "Disable"
  398. gun.Color = Color3.new(1,0,0)
  399. specialsound("rbxassetid://741894739", 5, 1, char, 33.878067323327, 35.438444041738)
  400. end
  401. end)
  402. addattack(Enum.KeyCode.P, function()
  403. if bgmusic.Playing then
  404. bgmusic:Stop()
  405. else
  406. bgmusic:Play()
  407. end
  408. end)
  409. addattack("MouseClick", function()
  410. if not attacking then
  411. cananim = false
  412. attacking = true
  413. for i = 0, 0.6, 0.1 do
  414. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
  415. rs.C1 = rs.C1:Lerp(CFrame.new(-0.235909924, 0.846874475, 0, 0.399310559, 0.00480417395, 0.916803062, -0.916736782, -0.0110294167, 0.399339437, 0.0120302998, -0.99992764, 5.25861077e-10), 0.6)
  416. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
  417. ls.C1 = ls.C1:Lerp(CFrame.new(0.232030958, 1.28329468, 0, 0.758646905, 0.0105680302, -0.651416421, 0.65135318, 0.00907341763, 0.758720517, 0.0139287533, -0.999902964, -6.08845141e-10), 0.6)
  418. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
  419. rh.C1 = rh.C1:Lerp(CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08), 0.6)
  420. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
  421. lh.C1 = lh.C1:Lerp(CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08), 0.6)
  422. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  423. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  424. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  425. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  426. swait()
  427. end
  428. local sounds = {
  429. {17.49, 17.981267708586};
  430. {17.490114626798, 17.755552823579};
  431. {18, 18.465876732586707476};
  432. }
  433. local ids = sounds[math.random(#sounds)]
  434. specialsound("rbxassetid://132938504", 5, 1, char, ids[1], ids[2])
  435. local p = Instance.new("Part")
  436. p.Anchored = false
  437. p.Material = "Neon"
  438. p.CanCollide = false
  439. local start = gun.Position +Vector3.new(0.5,0,-0.5)
  440. local endp = mouse.Hit.p
  441. local ray = Ray.new(start, (endp-start).unit * 999)
  442. local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {char, gun})
  443. local mag = (start-position).magnitude + 2
  444. p.Size = Vector3.new(0.1,0.1,mag)
  445. p.CFrame = CFrame.new(start, position) *CFrame.new(0,0,-mag/2)
  446. local bp = Instance.new("BodyPosition")
  447. bp.MaxForce = huge
  448. bp.Position = p.Position
  449. bp.Parent = p
  450. p.Color = gun.Color
  451. if mode == "Normal" then
  452. p.Color = Color3.new(1,1,1)
  453. end
  454. p.Parent = workspace
  455. spawn(function()
  456. for i = 1, 10 do
  457. p.Transparency = i/10
  458. swait()
  459. end
  460. p:Destroy()
  461. end)
  462. local con
  463. local dmg = 750
  464. if mode == "Heal" then dmg = -1000 end
  465. if mode == "Disable" then dmg = 0 end
  466. con = p.Touched:connect(function(hit)
  467. if hurt(hit, dmg) then
  468. pcall(function()
  469. con:disconnect()
  470. if mode == "Disable" then
  471. disable(hit)
  472. end
  473. for i,v in pairs(hit.Parent:GetDescendants()) do
  474. spawn(function()
  475. if v:IsA("BasePart") and mode == "Normal" then
  476. local bv = Instance.new("BodyVelocity")
  477. bv.MaxForce = huge
  478. bv.Velocity = CFrame.new(start, position).lookVector*100
  479. bv.Parent = v
  480. game:GetService('Debris'):AddItem(bv, 0.1)
  481. if v.Transparency <= 0.9 then
  482. for i = 1, 20 do
  483. v.Transparency = i/20
  484. swait()
  485. end
  486. end
  487. v:Destroy()
  488. end
  489. end)
  490. end
  491. end)
  492. end
  493. end)
  494. for i = 0, 0.3, 0.1 do
  495. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.8)
  496. rs.C1 = rs.C1:Lerp(CFrame.new(-0.108213484, 0.142491132, -0.0458124876, 0.399310559, 0.00480417395, 0.916803062, -0.907117367, -0.142995536, 0.395841271, 0.133000448, -0.989711702, -0.0527416691), 0.8)
  497. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.8)
  498. ls.C1 = ls.C1:Lerp(CFrame.new(-0.214841455, 0.866598129, -0.112976491, 0.758646905, 0.0105680302, -0.651416421, 0.64655149, -0.135239884, 0.750787199, -0.0801631361, -0.990756512, -0.109432101), 0.8)
  499. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.8)
  500. rh.C1 = rh.C1:Lerp(CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, -0.104150683, 0.994561553, -4.55257076e-09, -0.994561553, -0.104150683, -4.34736656e-08), 0.8)
  501. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.8)
  502. lh.C1 = lh.C1:Lerp(CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, -0.0883838907, 0.996086478, 3.8633825e-09, 0.996086478, 0.0883838907, -4.35403216e-08), 0.8)
  503. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.8)
  504. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.49999997, 0, -1, 0, 0, 0, 0.0492738597, 0.998785317, 0, 0.998785317, -0.0492738597), 0.8)
  505. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.8)
  506. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0.0276213959, 0.999618471, 0, 0.999618471, -0.0276213959), 0.8)
  507. swait()
  508. end
  509. cananim = true
  510. attacking = false
  511. end
  512. end)
  513. while true do
  514. swait()
  515. if currentanim == "Jumping" and cananim then
  516. for i = 0, 1.2, 0.1 do
  517. if currentanim ~= "Jumping" or not cananim then break end
  518. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.4)
  519. rs.C1 = rs.C1:Lerp(CFrame.new(0.0997244716, 0.195344329, -0.746855855, -0.155881107, 0.00388455181, 0.987768173, 0.260807574, -0.964343727, 0.0449508503, 0.952722609, 0.264624417, 0.149309859), 0.4)
  520. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.4)
  521. ls.C1 = ls.C1:Lerp(CFrame.new(0.793125331, 0.89348793, -0.0677016973, 0.986068428, -0.132806748, -0.100156575, 0.1031176, 0.0155911446, 0.994546831, -0.130520999, -0.991019309, 0.0290686507), 0.4)
  522. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.4)
  523. rh.C1 = rh.C1:Lerp(CFrame.new(0.49999997, 0.99999994, -4.47034836e-08, -0.0421661586, 0.0827250704, 0.995679915, 0.25110203, 0.965456486, -0.0695800334, -0.967041731, 0.247083336, -0.0614820197), 0.4)
  524. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.4)
  525. lh.C1 = lh.C1:Lerp(CFrame.new(-0.49999997, 1, 2.98023224e-08, 0.0194152314, 0, -0.99981153, 0.178683311, 0.983900607, 0.00346983178, 0.983715117, -0.178716987, 0.0191026554), 0.4)
  526. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  527. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0.0515226237, 0.99867183, 0, 0.99867183, -0.0515226237), 0.4)
  528. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  529. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0.128909558, -0.0269506648, -0.996639967, -0.0819067881, 0, -0.00100739487, 0.0122579783, 0.999924421, -0.0819005966, 0.996564567, -0.0122992992), 0.4)
  530. swait()
  531. end
  532. end
  533. if currentanim == "Falling" and cananim then
  534. for i = 0, 1.2, 0.1 do
  535. if currentanim ~= "Falling" or not cananim then break end
  536. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.4)
  537. rs.C1 = rs.C1:Lerp(CFrame.new(0.0997244716, 0.389569163, -0.799008012, -0.155881107, 0.00388455181, 0.987768173, 0.0170185864, -0.999833226, 0.00661772862, 0.987629175, 0.0178419873, 0.155789018), 0.4)
  538. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.4)
  539. ls.C1 = ls.C1:Lerp(CFrame.new(0.800841689, 0.89348793, 0.000534057617, 0.989977896, 0.0953866094, -0.104139231, 0.1031176, 0.0155911446, 0.994546831, 0.0964901, -0.995318174, 0.00559884822), 0.4)
  540. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.4)
  541. rh.C1 = rh.C1:Lerp(CFrame.new(0.49999997, 1, -1.49011612e-08, -0.0421661586, 0.0827250704, 0.995679915, -0.0600035824, 0.994557679, -0.085172914, -0.997307122, -0.0633357614, -0.0369728766), 0.4)
  542. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.4)
  543. lh.C1 = lh.C1:Lerp(CFrame.new(-0.499999881, 1, 3.7252903e-08, 0.0207479522, -0.155918092, -0.987552047, -0.00691960612, 0.987718761, -0.156089753, 0.999760866, 0.0100720376, 0.0194142479), 0.4)
  544. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  545. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0.0515226237, 0.99867183, 0, 0.99867183, -0.0515226237), 0.4)
  546. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  547. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0.313415587, -0.0163925812, -0.996639967, -0.0819067881, 0, 0.00564728118, -0.0687159598, 0.997620344, -0.0817118809, 0.994268239, 0.068947643), 0.4)
  548. swait()
  549. end
  550. end
  551. if currentanim == "Walking" and cananim then
  552. for i = 0, 0.6, 0.1 do
  553. if currentanim ~= "Walking" or not cananim then break end
  554. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
  555. rs.C1 = rs.C1:Lerp(CFrame.new(0.0997244716, -0.134959042, -0.791477084, -0.155881107, 0.00388455181, 0.987768173, 0.0728884861, -0.997220755, 0.0154243633, 0.985082865, 0.0744013041, 0.155164748), 0.6)
  556. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
  557. ls.C1 = ls.C1:Lerp(CFrame.new(0.728777826, 0.934069037, -0.221951187, 0.958276987, -0.133620545, -0.252687156, 0.254302055, -0.00512516592, 0.96711117, -0.130520999, -0.991019309, 0.0290686507), 0.6)
  558. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
  559. rh.C1 = rh.C1:Lerp(CFrame.new(0.49999997, 1, 0, -0.0421661586, 0.0827250704, 0.995679915, -0.568820775, 0.817300439, -0.0919936299, -0.82137984, -0.570242465, 0.0125933159), 0.6)
  560. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
  561. lh.C1 = lh.C1:Lerp(CFrame.new(-0.49999997, 1, 0, 0.0194152314, 0, -0.99981153, -0.845399499, 0.53388226, -0.0164167192, 0.533781588, 0.845558882, 0.0103654461), 0.6)
  562. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  563. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0.0515226237, 0.99867183, 0, 0.99867183, -0.0515226237), 0.6)
  564. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  565. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0.239933819, 0, -0.996639967, -0.0819067881, 0, 0.00819849782, -0.0997591168, 0.994977891, -0.0814954415, 0.991634667, 0.100095451), 0.6)
  566. swait()
  567. end
  568. local rslastc0 = rs.C0
  569. local rslastc1 = rs.C1
  570. local lslastc0 = ls.C0
  571. local lslastc1 = ls.C1
  572. local rhlastc0 = rh.C0
  573. local rhlastc1 = rh.C1
  574. local lhlastc0 = lh.C0
  575. local lhlastc1 = lh.C1
  576. local necklastc0 = neck.C0
  577. local necklastc1 = neck.C1
  578. local rjlastc0 = rj.C0
  579. local rjlastc1 = rj.C1
  580. local max = 0.6
  581. for i = 0, max, 0.1 do
  582. if currentanim ~= "Walking" or not cananim then break end
  583. rs.C0 = rslastc0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), i/max)
  584. rs.C1 = rslastc1:Lerp(CFrame.new(0.0997244716, -0.134959042, -0.791477084, -0.155881107, 0.00388455181, 0.987768173, 0.0728884861, -0.997220755, 0.0154243633, 0.985082865, 0.0744013041, 0.155164748), i/max)
  585. ls.C0 = lslastc0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), i/max)
  586. ls.C1 = lslastc1:Lerp(CFrame.new(0.728777826, 0.934069037, -0.221951187, 0.958276987, -0.133620545, -0.252687156, 0.254302055, -0.00512516592, 0.96711117, -0.130520999, -0.991019309, 0.0290686507), i/max)
  587. rh.C0 = rhlastc0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), i/max)
  588. rh.C1 = rhlastc1:Lerp(CFrame.new(0.5, 0.675323606, 0, -0.0421661623, 0.0827250704, 0.995679975, 0.221647412, 0.972508371, -0.0714133158, -0.974214792, 0.217678651, -0.059342742), i/max)
  589. lh.C0 = lhlastc0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), i/max)
  590. lh.C1 = lhlastc1:Lerp(CFrame.new(-0.49999997, 0.680277288, -1.49011612e-08, 0.0194152296, -2.24613939e-11, -0.99981153, -0.183868393, 0.982944369, -0.00357052009, 0.982759118, 0.183903053, 0.0190840904), i/max)
  591. neck.C0 = necklastc0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  592. neck.C1 = necklastc1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0.0515226237, 0.99867183, 0, 0.99867183, -0.0515226237), i/max)
  593. rj.C0 = rjlastc0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  594. rj.C1 = rjlastc1:Lerp(CFrame.new(0, 0.169720784, 0, -0.996639967, -0.0819067881, 0, 0.00819849782, -0.0997591168, 0.994977891, -0.0814954415, 0.991634667, 0.100095451), i/max)
  595. swait()
  596. end
  597. for i = 0, 0.6, 0.1 do
  598. if currentanim ~= "Walking" or not cananim then break end
  599. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
  600. rs.C1 = rs.C1:Lerp(CFrame.new(0.0997244716, -0.134959042, -0.791477084, -0.155881107, 0.00388455181, 0.987768173, 0.0728884861, -0.997220755, 0.0154243633, 0.985082865, 0.0744013041, 0.155164748), 0.6)
  601. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
  602. ls.C1 = ls.C1:Lerp(CFrame.new(0.728777826, 0.934069037, -0.221951187, 0.958276987, -0.133620545, -0.252687156, 0.254302055, -0.00512516592, 0.96711117, -0.130520999, -0.991019309, 0.0290686507), 0.6)
  603. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.6)
  604. rh.C1 = rh.C1:Lerp(CFrame.new(0.49999997, 1, 0, -0.0421661586, 0.0827250704, 0.995679915, 0.868188143, 0.496215105, -0.00446053827, -0.494440407, 0.864249468, -0.0927444026), 0.6)
  605. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.6)
  606. lh.C1 = lh.C1:Lerp(CFrame.new(-0.49999997, 1, 0, 0.0194152314, 0, -0.99981153, 0.595236421, 0.803467572, 0.0115588298, 0.803316057, -0.595348656, 0.015599506), 0.6)
  607. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  608. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0.0515226237, 0.99867183, 0, 0.99867183, -0.0515226237), 0.6)
  609. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  610. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0.342528641, -9.31322575e-10, -0.996639967, -0.0819067955, -6.22866592e-10, 0.00819849595, -0.0997591242, 0.994977832, -0.0814954415, 0.991634727, 0.100095443), 0.6)
  611. swait()
  612. end
  613. local rslastc0 = rs.C0
  614. local rslastc1 = rs.C1
  615. local lslastc0 = ls.C0
  616. local lslastc1 = ls.C1
  617. local rhlastc0 = rh.C0
  618. local rhlastc1 = rh.C1
  619. local lhlastc0 = lh.C0
  620. local lhlastc1 = lh.C1
  621. local necklastc0 = neck.C0
  622. local necklastc1 = neck.C1
  623. local rjlastc0 = rj.C0
  624. local rjlastc1 = rj.C1
  625. local max = 0.6
  626. for i = 0, max, 0.1 do
  627. if currentanim ~= "Walking" or not cananim then break end
  628. rs.C0 = rslastc0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), i/max)
  629. rs.C1 = rslastc1:Lerp(CFrame.new(0.0997244716, -0.134959042, -0.791477084, -0.155881107, 0.00388455181, 0.987768173, 0.0728884861, -0.997220755, 0.0154243633, 0.985082865, 0.0744013041, 0.155164748), i/max)
  630. ls.C0 = lslastc0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), i/max)
  631. ls.C1 = lslastc1:Lerp(CFrame.new(0.728777826, 0.934069037, -0.221951187, 0.958276987, -0.133620545, -0.252687156, 0.254302055, -0.00512516592, 0.96711117, -0.130520999, -0.991019309, 0.0290686507), i/max)
  632. rh.C0 = rhlastc0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), i/max)
  633. rh.C1 = rhlastc1:Lerp(CFrame.new(0.5, 0.675323606, 0, -0.0421661623, 0.0827250704, 0.995679975, 0.221647412, 0.972508371, -0.0714133158, -0.974214792, 0.217678651, -0.059342742), i/max)
  634. lh.C0 = lhlastc0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), i/max)
  635. lh.C1 = lhlastc1:Lerp(CFrame.new(-0.49999997, 0.680277288, -1.49011612e-08, 0.0194152296, -2.24613939e-11, -0.99981153, -0.183868393, 0.982944369, -0.00357052009, 0.982759118, 0.183903053, 0.0190840904), i/max)
  636. neck.C0 = necklastc0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  637. neck.C1 = necklastc1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0.0515226237, 0.99867183, 0, 0.99867183, -0.0515226237), i/max)
  638. rj.C0 = rjlastc0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  639. rj.C1 = rjlastc1:Lerp(CFrame.new(5.82076609e-11, 0.2270886, 2.32830644e-10, -0.996639967, -0.0819067881, 4.13409307e-10, 0.00819849502, -0.0997591093, 0.994977832, -0.081495434, 0.991634727, 0.100095429), i/max)
  640. wait()
  641. end
  642. end
  643. if currentanim == "Idle" and cananim then
  644. for i = 0, 5, 0.1 do
  645. if currentanim ~= "Idle" or not cananim then break end
  646. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.05)
  647. rs.C1 = rs.C1:Lerp(CFrame.new(0.0997244716, -0.105339587, -1.12973166, -0.155881107, 0.00388455181, 0.987768173, -0.0249122381, -0.999689579, -1.08894849e-09, 0.987461567, -0.0246075168, 0.155929506), 0.05)
  648. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.05)
  649. ls.C1 = ls.C1:Lerp(CFrame.new(0.998242438, 0.966719627, -0.251513988, 0.948773444, -0.0191214401, -0.315378129, 0.315314144, -0.00635479437, 0.948966026, -0.0201497618, -0.999796987, 8.80774065e-10), 0.05)
  650. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.05)
  651. rh.C1 = rh.C1:Lerp(CFrame.new(0.5, 1, 0, -0.246849835, 0, 0.969053745, 0, 1, 0, -0.969053745, 0, -0.246849835), 0.05)
  652. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.05)
  653. lh.C1 = lh.C1:Lerp(CFrame.new(-0.5, 1, 0, 0.0194152314, 0, -0.99981153, 0, 1, 0, 0.99981153, 0, 0.0194152314), 0.05)
  654. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  655. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  656. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  657. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0, 0, -0.996639967, -0.0819067881, 0, 0, 0, 1, -0.0819067881, 0.996639967, 0), 0.05)
  658. swait()
  659. end
  660. for i = 0, 5, 0.1 do
  661. if currentanim ~= "Idle" or not cananim then break end
  662. rs.C0 = rs.C0:Lerp(CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.05)
  663. rs.C1 = rs.C1:Lerp(CFrame.new(0.0997244716, -0.134959042, -1.07218063, -0.155881107, 0.00388455181, 0.987768173, 0.0728884861, -0.997220755, 0.0154243633, 0.985082865, 0.0744013041, 0.155164748), 0.05)
  664. ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.05)
  665. ls.C1 = ls.C1:Lerp(CFrame.new(0.994734883, 0.934069037, -0.221951187, 0.958276987, -0.133620545, -0.252687156, 0.254302055, -0.00512516592, 0.96711117, -0.130520999, -0.991019309, 0.0290686507), 0.05)
  666. rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08), 0.05)
  667. rh.C1 = rh.C1:Lerp(CFrame.new(0.5, 1, 0, -0.246849835, 0, 0.969053745, 0, 1, 0, -0.969053745, 0, -0.246849835), 0.05)
  668. lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08), 0.05)
  669. lh.C1 = lh.C1:Lerp(CFrame.new(-0.49999997, 1, 0, 0.0194152314, 0, -0.99981153, 0, 1, 0, 0.99981153, 0, 0.0194152314), 0.05)
  670. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  671. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  672. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  673. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0, 0, -0.996639967, -0.0819067881, 0, -0.00139390712, 0.0169610307, 0.999855161, -0.0818949267, 0.996495605, -0.017018212), 0.05)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement