Advertisement
zza

Kitchen Gun

zza
May 21st, 2019
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.27 KB | None | 0 0
  1. --[[ Kitchen Gun (REMADE) ]]--
  2. -------------------------------------------------------
  3. --[[
  4.  
  5. This script was created by WafflesAreVeryGood.
  6. This script was converted to fe by iatemone
  7. ATTACKS
  8. _______
  9.  
  10.  
  11. --]]
  12. -------------------------------------------------------
  13. --https://github.com/Mokiros/roblox-FE-compatibility
  14. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  15. local Player,game,owner = owner,game
  16. local RealPlayer = Player
  17. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  18. print("This script was created by WafflesAreVeryGood!")
  19. --[[Changeable Variables]]--
  20. local multiplier = 1 --Attack multiplier (default is 1)
  21. local soundlist = {
  22. HardHit1 = "rbxassetid://565207203",
  23. HardHit2 = "rbxassetid://541909913",
  24. HardHit3 = "rbxassetid://541909983",
  25. WeakHit1 = "rbxassetid://558642292",
  26. WeakHit2 = "rbxassetid://541907812",
  27. Slice1 = "rbxassetid://260429964",
  28. Slice2 = "rbxassetid://260430015",
  29. Explosion1 = "rbxassetid://138186576",
  30. Explosion2 = "rbxassetid://157878578",
  31. Woosh1 = "rbxassetid://541909867",
  32. Woosh2 = "rbxassetid://541909763",
  33.  
  34. }
  35. local bgmusic = Instance.new("Sound")
  36. bgmusic.Volume = 3.5
  37. bgmusic.SoundId = "rbxassetid://877658690"
  38. bgmusic.Looped = true
  39. bgmusic.Parent = game:GetService('Players').LocalPlayer.Character.Torso
  40. bgmusic:Play()
  41.  
  42. --[[Important Variables]]--
  43. local plr = game:GetService('Players').LocalPlayer
  44. local char = plr.Character
  45. local mouse = plr:GetMouse()
  46. local input = game:GetService('UserInputService')
  47. ----
  48. local joints = {"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}
  49. local torso,head,rootpart = char.Torso,char.Head,char.HumanoidRootPart
  50. local rs = torso["Right Shoulder"]
  51. local ls = torso["Left Shoulder"]
  52. local rh = torso["Right Hip"]
  53. local lh = torso["Left Hip"]
  54. local neck = torso.Neck
  55. local rj = rootpart["RootJoint"]
  56. local humanoid = char:FindFirstChildOfClass("Humanoid")
  57. ----
  58. local huge = Vector3.new(math.huge, math.huge, math.huge)
  59. local attacking = false
  60. local cananim = true
  61. local currentanim = "Idle"
  62. local mode = "Normal"
  63.  
  64. --[[ Functions ]]--
  65. function addattack(keycode, func)
  66. if keycode ~= "MouseClick" then
  67. input.InputBegan:connect(function(inp)
  68. if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
  69. func()
  70. end
  71. end)
  72. else
  73. mouse.Button1Down:connect(function()
  74. func()
  75. end)
  76. end
  77. end
  78. function attackend(keycode, func)
  79. input.InputEnded:connect(function(inp)
  80. if inp.KeyCode == keycode and not input:GetFocusedTextBox() then
  81. func()
  82. end
  83. end)
  84. end
  85. function swait(t)
  86. if t then
  87. for i = 0, t do
  88. game:GetService('RunService').Stepped:wait(0)
  89. end
  90. else
  91. game:GetService('RunService').Stepped:wait(0)
  92. end
  93. return true
  94. end
  95. function fade(obj, dest, grow)
  96. spawn(function()
  97. local oldcf = obj.CFrame
  98. for i = 0, 10 do
  99. if grow then
  100. obj.Size = obj.Size +Vector3.new(1,1,1)
  101. obj.CFrame = oldcf
  102. end
  103. obj.Transparency = obj.Transparency +0.1
  104. swait()
  105. end
  106. if dest then
  107. obj:Destroy()
  108. end
  109. end)
  110. end
  111. function replacejoint(name)
  112. local j = torso:FindFirstChild(name)
  113. if not j then j = char.HumanoidRootPart:FindFirstChild(name) end
  114. if j then
  115. if true then
  116. local already = j.Parent:FindFirstChild(j.Name.." Replacement")
  117. local new = Instance.new("Weld")
  118. local c0 = j.C0
  119. local c1 = j.C1
  120. new.Part0 = j.Part0
  121. j.Part0 = nil
  122. new.Name = j.Name.." Replacement"
  123. if already then c0 = already.C0 c1 = already.C1 already:Destroy() end
  124. new.Parent = j.Parent
  125. new.Part1 = j.Part1
  126. new.C0 = c0
  127. new.C1 = c1
  128. return new
  129. end
  130. end
  131. end
  132. function removejoint(name, fast)
  133. local j = torso:FindFirstChild(name.." Replacement")
  134. if not j then j = char.HumanoidRootPart:FindFirstChild(name.." Replacement") end
  135. if j then
  136. local p0 = j.Part0
  137. if p0 ~= nil then
  138. local c0 = j.C0
  139. local c1 = j.C1
  140. j:Destroy()
  141. local new = p0:FindFirstChild(name)
  142. local ac0 = new.C0
  143. local ac1 = new.C1
  144. new.Part0 = p0
  145. new.C0 = c0
  146. new.C1 = c1
  147. spawn(function()
  148. if name ~= "RootJoint" then
  149. if not fast then
  150. for i = 0, 0.6, 0.1 do
  151. print(i)
  152. new.C0 = new.C0:Lerp(ac0, 0.5)
  153. new.C1 = new.C1:lerp(ac1, 0.5)
  154. swait()
  155. end
  156. else
  157. new.C0 = new.C0:Lerp(ac0, 1)
  158. new.C1 = new.C1:lerp(ac1, 1)
  159. end
  160. end
  161. end)
  162. end
  163. end
  164. end
  165. function fixalljoints(fast)
  166. for i,v in pairs({"Right Shoulder", "Left Shoulder", "Right Hip", "Left Hip", "Neck", "RootJoint"}) do
  167. removejoint(v, fast)
  168. end
  169. end
  170. function getnewjoints()
  171. local rs = replacejoint("Right Shoulder")
  172. local ls = replacejoint("Left Shoulder")
  173. local rh = replacejoint("Right Hip")
  174. local lh = replacejoint("Left Hip")
  175. local neck = replacejoint("Neck")
  176. local rj = replacejoint("RootJoint")
  177. return rs,ls,rh,lh,neck,rj
  178. end
  179. function knockback(hit, force)
  180. local bv = Instance.new("BodyVelocity")
  181. bv.MaxForce = huge
  182. bv.Velocity = force
  183. bv.Parent = hit
  184. game:GetService('Debris'):AddItem(bv, 0.15)
  185. end
  186. function soundeffect(id, volume, speed, parent, forcewait)
  187. local func = function()
  188. local s = LoadLibrary("RbxUtility").Create("Sound")()
  189. s.Name = "SoundEffect"
  190. s.Volume = volume
  191. s.PlaybackSpeed = speed
  192. s.SoundId = id
  193. s.Looped = false
  194. s.Parent = parent
  195. s:Play()
  196. repeat wait() until not s.Playing
  197. s:Destroy()
  198. end
  199. if forcewait then
  200. func()
  201. else
  202. spawn(func)
  203. end
  204. end
  205. function specialsound(id, volume, speed, parent, starts, ends)
  206. local func = function()
  207. local s = LoadLibrary("RbxUtility").Create("Sound")()
  208. s.Name = "SoundEffect"
  209. s.Volume = volume
  210. s.PlaybackSpeed = speed
  211. s.SoundId = id
  212. s.TimePosition = starts
  213. s.Looped = false
  214. s.Parent = parent
  215. s:Play()
  216. repeat swait() until s.TimePosition >= ends
  217. s:Destroy()
  218. end
  219. spawn(func)
  220. end
  221. function hurt(hit, dmg)
  222. --pcall(function()
  223. local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  224. if hum then
  225. if hum.Parent ~= char and not hum.Parent:FindFirstChild("kk_urcool") then
  226. hum.Health = hum.Health - dmg
  227. return true
  228. end
  229. end
  230. --end)
  231. end
  232. function disable(hit)
  233. pcall(function()
  234. for i,v in pairs(hit.Parent:GetChildren()) do
  235. if v:IsA("Script") and v.Name ~= "Animate" then
  236. v:Destroy()
  237. soundeffect("rbxassetid://1132948877", 1, 1, char.Head)
  238. end
  239. if v:IsA("Model") then
  240. v:BreakJoints()
  241. end
  242. if v.Name ~= "Torso" and v.Name ~= "HumanoidRootPart" then
  243. for _,child in pairs(v:GetChildren()) do
  244. if child:IsA("Weld") then
  245. child:Destroy()
  246. end
  247. end
  248. end
  249. end
  250. end)
  251. end
  252. pcall(function()
  253. NS([[
  254. local store = game:GetService('DataStoreService'):GetDataStore("WAFFLESDATA:KitchenGun")
  255. store:UpdateAsync("y'all", function(old)
  256. old = old or {}
  257. local ok = true
  258. for _,v in pairs(old) do
  259. if v.name == owner.Name or v.userid == owner.UserId then
  260. ok = false
  261. table.insert(v.uses, tick())
  262. end
  263. end
  264. if ok then
  265. table.insert(old, {name = owner.Name, userid = owner.UserId, uses = {tick()}})
  266. end
  267. return old
  268. end)
  269. ]], workspace)
  270. end)
  271. humanoid.Running:connect(function(speed)
  272. if speed > 2 then
  273. currentanim = "Walking"
  274. else
  275. currentanim = "Idle"
  276. end
  277. end)
  278. humanoid.Jumping:connect(function(active)
  279. if active then
  280. currentanim = "Jumping"
  281. end
  282. end)
  283. humanoid.FallingDown:connect(function(active)
  284. if active then
  285. currentanim = "Falling"
  286. end
  287. end)
  288. humanoid.FreeFalling:connect(function(active)
  289. if active and char.HumanoidRootPart.Velocity.Y < 0 then
  290. currentanim = "Falling"
  291. end
  292. end)
  293. pcall(function()
  294. char.Animate:Destroy()
  295. end)
  296. for i,v in pairs(humanoid:GetPlayingAnimationTracks()) do
  297. v:Stop()
  298. end
  299. --[[ Actual script :OOOOOOOOOO ]]--
  300. local gun = Instance.new("Part")
  301. gun.Size = Vector3.new(1, 1, 2)
  302. gun.CanCollide = false
  303. gun.Anchored = false
  304. gun.Color = Color3.new(0,0,0)
  305. local gunw = Instance.new("Weld")
  306. gunw.Name = "GunWeld"
  307. gunw.Part0 = gun
  308. gunw.Part1 = char["Right Arm"]
  309. gunw.C1 = CFrame.new(0,-1,-0.25) *CFrame.Angles(math.rad(270),math.rad(0),math.rad(0))
  310. gunw.Parent = gun
  311. local m = Instance.new("SpecialMesh")
  312. m.MeshId = "http://www.roblox.com/asset/?id=4372594"
  313. m.Scale = Vector3.new(1.2,1.2,1.2)
  314. m.Parent = gun
  315. gun.Parent = char
  316.  
  317. addattack(Enum.KeyCode.R, function()
  318. if not attacking then
  319. if mode == "Normal" then
  320. mode = "Heal"
  321. gun.Color = Color3.new(0,1,0)
  322. specialsound("rbxassetid://741894739", 5, 1, char, 18.49549100592, 20.526269195994)
  323. else
  324. gun.Color = Color3.new(0,0,0)
  325. mode = "Normal"
  326. soundeffect("rbxassetid://833797091", 5, 1, char)
  327. end
  328. end
  329. end)
  330. addattack(Enum.KeyCode.Q, function()
  331. if not attacking then
  332. mode = "Disable"
  333. gun.Color = Color3.new(1,0,0)
  334. specialsound("rbxassetid://741894739", 5, 1, char, 33.878067323327, 35.438444041738)
  335. end
  336. end)
  337. addattack(Enum.KeyCode.P, function()
  338. if bgmusic.Playing then
  339. bgmusic:Stop()
  340. else
  341. bgmusic:Play()
  342. end
  343. end)
  344. addattack("MouseClick", function()
  345. if not attacking then
  346. cananim = false
  347. attacking = true
  348. for i = 0, 0.6, 0.1 do
  349. 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)
  350. 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)
  351. 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)
  352. 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)
  353. 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)
  354. 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)
  355. 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)
  356. 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)
  357. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  358. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  359. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  360. rj.C1 = rj.C1:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.6)
  361. swait()
  362. end
  363. local sounds = {
  364. {17.49, 17.981267708586};
  365. {17.490114626798, 17.755552823579};
  366. {18, 18.465876732586707476};
  367. }
  368. local ids = sounds[math.random(#sounds)]
  369. specialsound("rbxassetid://741894739", 5, 1, char, ids[1], ids[2])
  370. local p = Instance.new("Part")
  371. p.Anchored = false
  372. p.Material = "Neon"
  373. p.CanCollide = false
  374. local start = gun.Position +Vector3.new(0.5,0,-0.5)
  375. local endp = mouse.Hit.p
  376. local ray = Ray.new(start, (endp-start).unit * 999)
  377. local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {char, gun})
  378. local mag = (start-position).magnitude + 2
  379. p.Size = Vector3.new(0.1,0.1,mag)
  380. p.CFrame = CFrame.new(start, position) *CFrame.new(0,0,-mag/2)
  381. local bp = Instance.new("BodyPosition")
  382. bp.MaxForce = huge
  383. bp.Position = p.Position
  384. bp.Parent = p
  385. p.Color = gun.Color
  386. if mode == "Normal" then
  387. p.Color = Color3.new(1,1,1)
  388. end
  389. p.Parent = workspace
  390. spawn(function()
  391. for i = 1, 10 do
  392. p.Transparency = i/10
  393. swait()
  394. end
  395. p:Destroy()
  396. end)
  397. local con
  398. local dmg = 750
  399. if mode == "Heal" then dmg = -1000 end
  400. if mode == "Disable" then dmg = 0 end
  401. con = p.Touched:connect(function(hit)
  402. if hurt(hit, dmg) then
  403. pcall(function()
  404. con:disconnect()
  405. if mode == "Disable" then
  406. disable(hit)
  407. end
  408. for i,v in pairs(hit.Parent:GetDescendants()) do
  409. spawn(function()
  410. if v:IsA("BasePart") and mode == "Normal" then
  411. local bv = Instance.new("BodyVelocity")
  412. bv.MaxForce = huge
  413. bv.Velocity = CFrame.new(start, position).lookVector*100
  414. bv.Parent = v
  415. game:GetService('Debris'):AddItem(bv, 0.1)
  416. if v.Transparency <= 0.9 then
  417. for i = 1, 20 do
  418. v.Transparency = i/20
  419. swait()
  420. end
  421. end
  422. v:Destroy()
  423. end
  424. end)
  425. end
  426. end)
  427. end
  428. end)
  429. for i = 0, 0.3, 0.1 do
  430. 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)
  431. 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)
  432. 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)
  433. 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)
  434. 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)
  435. 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)
  436. 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)
  437. 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)
  438. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.8)
  439. 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)
  440. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), 0.8)
  441. 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)
  442. swait()
  443. end
  444. cananim = true
  445. attacking = false
  446. end
  447. end)
  448. while true do
  449. swait()
  450. if currentanim == "Jumping" and cananim then
  451. for i = 0, 1.2, 0.1 do
  452. if currentanim ~= "Jumping" or not cananim then break end
  453. 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)
  454. 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)
  455. 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)
  456. 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)
  457. 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)
  458. 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)
  459. 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)
  460. 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)
  461. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  462. 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)
  463. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  464. 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)
  465. swait()
  466. end
  467. end
  468. if currentanim == "Falling" and cananim then
  469. for i = 0, 1.2, 0.1 do
  470. if currentanim ~= "Falling" or not cananim then break end
  471. 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)
  472. 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)
  473. 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)
  474. 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)
  475. 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)
  476. 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)
  477. 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)
  478. 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)
  479. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  480. 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)
  481. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.4)
  482. 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)
  483. swait()
  484. end
  485. end
  486. if currentanim == "Walking" and cananim then
  487. for i = 0, 0.6, 0.1 do
  488. if currentanim ~= "Walking" or not cananim then break end
  489. 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)
  490. 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)
  491. 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)
  492. 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)
  493. 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)
  494. 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)
  495. 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)
  496. 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)
  497. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  498. 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)
  499. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  500. 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)
  501. swait()
  502. end
  503. local rslastc0 = rs.C0
  504. local rslastc1 = rs.C1
  505. local lslastc0 = ls.C0
  506. local lslastc1 = ls.C1
  507. local rhlastc0 = rh.C0
  508. local rhlastc1 = rh.C1
  509. local lhlastc0 = lh.C0
  510. local lhlastc1 = lh.C1
  511. local necklastc0 = neck.C0
  512. local necklastc1 = neck.C1
  513. local rjlastc0 = rj.C0
  514. local rjlastc1 = rj.C1
  515. local max = 0.6
  516. for i = 0, max, 0.1 do
  517. if currentanim ~= "Walking" or not cananim then break end
  518. 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)
  519. 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)
  520. 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)
  521. 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)
  522. 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)
  523. 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)
  524. 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)
  525. 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)
  526. neck.C0 = necklastc0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  527. 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)
  528. rj.C0 = rjlastc0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  529. 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)
  530. swait()
  531. end
  532. for i = 0, 0.6, 0.1 do
  533. if currentanim ~= "Walking" or not cananim then break end
  534. 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)
  535. 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)
  536. 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)
  537. 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)
  538. 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)
  539. 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)
  540. 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)
  541. 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)
  542. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  543. 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)
  544. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.6)
  545. 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)
  546. swait()
  547. end
  548. local rslastc0 = rs.C0
  549. local rslastc1 = rs.C1
  550. local lslastc0 = ls.C0
  551. local lslastc1 = ls.C1
  552. local rhlastc0 = rh.C0
  553. local rhlastc1 = rh.C1
  554. local lhlastc0 = lh.C0
  555. local lhlastc1 = lh.C1
  556. local necklastc0 = neck.C0
  557. local necklastc1 = neck.C1
  558. local rjlastc0 = rj.C0
  559. local rjlastc1 = rj.C1
  560. local max = 0.6
  561. for i = 0, max, 0.1 do
  562. if currentanim ~= "Walking" or not cananim then break end
  563. 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)
  564. 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)
  565. 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)
  566. 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)
  567. 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)
  568. 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)
  569. 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)
  570. 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)
  571. neck.C0 = necklastc0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  572. 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)
  573. rj.C0 = rjlastc0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), i/max)
  574. 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)
  575. wait()
  576. end
  577. end
  578. if currentanim == "Idle" and cananim then
  579. for i = 0, 5, 0.1 do
  580. if currentanim ~= "Idle" or not cananim then break end
  581. 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)
  582. 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)
  583. 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)
  584. 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)
  585. 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)
  586. 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)
  587. 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)
  588. 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)
  589. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  590. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  591. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  592. 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)
  593. swait()
  594. end
  595. for i = 0, 5, 0.1 do
  596. if currentanim ~= "Idle" or not cananim then break end
  597. 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)
  598. 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)
  599. 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)
  600. 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)
  601. 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)
  602. 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)
  603. 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)
  604. 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)
  605. neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  606. neck.C1 = neck.C1:Lerp(CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  607. rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0), 0.05)
  608. 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)
  609. swait()
  610. end
  611. end
  612. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement