Advertisement
filipaopastebins2134

Larva Snowball Fight v1.3

Feb 24th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.50 KB | None | 0 0
  1. -- Farewell Infortality.
  2. -- Version: 2.82
  3. -- Instances:
  4. local ScreenGui = Instance.new("ScreenGui")
  5. local ImageLabel = Instance.new("ImageLabel")
  6. local HealthFrame = Instance.new("Frame")
  7. local HealthBar = Instance.new("Frame")
  8. local ImageButton = Instance.new("ImageButton")
  9. --Properties:
  10. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  11.  
  12. ImageLabel.Parent = ScreenGui
  13. ImageLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  14. ImageLabel.BackgroundTransparency = 100
  15. ImageLabel.Position = UDim2.new(0.658964872, 0, 0, 0)
  16. ImageLabel.Size = UDim2.new(0, 369, 0, 146)
  17. ImageLabel.Image = "rbxassetid://2889967040"
  18.  
  19. HealthFrame.Name = "HealthFrame"
  20. HealthFrame.Parent = ScreenGui
  21. HealthFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  22. HealthFrame.BorderColor3 = Color3.new(1, 0.666667, 0)
  23. HealthFrame.BorderSizePixel = 5
  24. HealthFrame.Position = UDim2.new(0.711110651, 0, 0.0352899209, 0)
  25. HealthFrame.Size = UDim2.new(0, 154, 0, 49)
  26.  
  27. HealthBar.Name = "HealthBar"
  28. HealthBar.Parent = HealthFrame
  29. HealthBar.BackgroundColor3 = Color3.new(0, 1, 0)
  30. HealthBar.BorderSizePixel = 0
  31. HealthBar.Position = UDim2.new(-0.00404100306, 0, -0.00621079421, 0)
  32. HealthBar.Size = UDim2.new(0, 154, 0, 49)
  33.  
  34. ImageButton.Parent = ScreenGui
  35. ImageButton.BackgroundColor3 = Color3.new(0, 0, 0)
  36. ImageButton.Position = UDim2.new(0.907578588, 0, 0.794915259, 0)
  37. ImageButton.Size = UDim2.new(0, 100, 0, 100)
  38. ImageButton.Image = "rbxassetid://100513649"
  39. -- Scripts:
  40. function SCRIPT_TMTU83_FAKESCRIPT() -- HealthBar.LocalScript
  41. local script = Instance.new('LocalScript')
  42. script.Parent = HealthBar
  43. wait(.1)
  44. while true do
  45. hp = game.Players.LocalPlayer.Character.Humanoid.Health/100
  46. script.Parent:TweenSize(UDim2.new(hp,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.15)
  47. wait(.2)
  48. end
  49.  
  50. end
  51. coroutine.resume(coroutine.create(SCRIPT_TMTU83_FAKESCRIPT))
  52. function SCRIPT_NOBB79_FAKESCRIPT() -- ImageButton.LocalScript
  53. local script = Instance.new('LocalScript')
  54. script.Parent = ImageButton
  55. function click()
  56. repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil;
  57. wait(0.5)
  58.  
  59. S = Instance.new("Model")
  60. S.Name = "ValueChanger1"
  61. S.Parent = Game.Workspace
  62. --- vars ---
  63. local player = game:GetService("Players").LocalPlayer
  64. local repstor = game:GetService("ReplicatedStorage")
  65. local mouse = player:GetMouse()
  66. local char = player.Character
  67. local Hu = char.Humanoid
  68. local Gui = player:WaitForChild("PlayerGui")
  69. local Torsoz = char:findFirstChild("Torso")
  70. local HRP = char:findFirstChild("HumanoidRootPart")
  71. local HRJ = HRP:findFirstChild("RootJoint")
  72. local RA = char:findFirstChild("Right Arm")
  73. local LA = char:findFirstChild("Left Arm")
  74. local RL = char:findFirstChild("Right Leg")
  75. local LL = char:findFirstChild("Left Leg")
  76. local H = char:findFirstChild("Head")
  77. local RS = Torsoz:findFirstChild("Right Shoulder")
  78. local LS = Torsoz:findFirstChild("Left Shoulder")
  79. local RH = Torsoz:findFirstChild("Right Hip")
  80. local LH = Torsoz:findFirstChild("Left Hip")
  81. local N = Torsoz:findFirstChild("Neck")
  82. local NV = Vector3.new()
  83. local Main
  84. local SPB,SPF,SPC,SnowPart
  85. local SPCP = 0
  86. local Animating = false
  87. local Walkspeed = 16
  88. local Shift, Alt, Space, MouseDown = false, false, false, false
  89. local ThrowingSequence = false
  90. local SlideCooldown = 0
  91. local SnowballProjectiles, SnowSplosionEffects = {}, {}
  92. local disableJump = false
  93.  
  94. local AnimSpeeds = {
  95. 0.5; -- idle
  96. 5; -- walking
  97. 6.5; -- running
  98. 7; -- jumping
  99. 7; -- falling
  100. }
  101.  
  102. for i, v in pairs(char:children()) do
  103. if v.Name == "Cheese" then
  104. v:remove()
  105. end
  106. end
  107. script.Parent = char
  108. script.Name = "Cheese"
  109.  
  110. ------------ animation funcs & other things ---------------
  111. local P = Instance.new("Part")
  112. P.Anchored = false
  113. P.CanCollide = false
  114. P.Name = "Part"
  115. P.formFactor = "Custom"
  116. P.Size = Vector3.new(0.2,0.2,0.2)
  117. P.Locked = true
  118. P.TopSurface = 10
  119. P.BottomSurface = 10
  120. P.FrontSurface = 10
  121. P.BackSurface = 10
  122. P.LeftSurface = 10
  123. P.RightSurface = 10
  124.  
  125. function GetWeld(weld)
  126. if weld:findFirstChild("WeldAngle") == nil then
  127. local a = Instance.new("Vector3Value", weld)
  128. a.Name = "WeldAngle"
  129. end
  130. return weld.C0.p, weld.WeldAngle.Value
  131. end
  132.  
  133. function SetWeld(weld, i, loops, origpos,origangle, nextpos,nextangle,smooth)
  134. smooth = smooth or 1
  135. if weld:findFirstChild("WeldAngle") == nil then
  136. local a = Instance.new("Vector3Value", weld)
  137. a.Name = "WeldAngle"
  138. end
  139.  
  140. local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
  141.  
  142. local tox,toy,toz = 0,0,0
  143. tox = math.abs(origangle.x - nextangle.x) *perc
  144. toy = math.abs(origangle.y - nextangle.y) *perc
  145. toz = math.abs(origangle.z - nextangle.z) *perc
  146. tox = (origangle.x > nextangle.x and -tox) or tox
  147. toy = (origangle.y > nextangle.y and -toy) or toy
  148. toz = (origangle.z > nextangle.z and -toz) or toz
  149.  
  150. local tox2,toy2,toz2 = 0,0,0
  151. tox2 = math.abs(origpos.x - nextpos.x) *perc
  152. toy2 = math.abs(origpos.y - nextpos.y) *perc
  153. toz2 = math.abs(origpos.z - nextpos.z) *perc
  154. tox2 = (origpos.x > nextpos.x and -tox2) or tox2
  155. toy2 = (origpos.y > nextpos.y and -toy2) or toy2
  156. toz2 = (origpos.z > nextpos.z and -toz2) or toz2
  157.  
  158. weld.WeldAngle.Value = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
  159. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  160. end
  161.  
  162. function RAY(pos, dir, startpos, endpos, distleft, collidedlist)
  163. collidedlist = collidedlist or {char}
  164. startpos = startpos or pos
  165. distleft = distleft or dir.unit * dir.magnitude
  166. endpos = endpos or pos + distleft
  167. local ray = Ray.new(pos, distleft)
  168. local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist)
  169. if hitz ~= nil then
  170. if hitz.CanCollide == false then
  171. table.insert(collidedlist, hitz)
  172. local newpos = enz
  173. local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude)
  174. if newdistleft ~= NV then
  175. return RAY(newpos-(dir*0.01), dir, startpos, endpos, newdistleft+(dir*0.01), collidedlist)
  176. end
  177. end
  178. end
  179. return hitz, enz, ray
  180. end
  181.  
  182. function ChangeValue(obj,type,value)
  183. local val = Instance.new("ObjectValue")
  184. val.Name = type
  185. val.Value = obj
  186. local val2 = Instance.new("NumberValue",val)
  187. val2.Name = "value"
  188. val2.Value = value
  189. if type == "PingTestIncrement" then
  190. local val3 = Instance.new("NumberValue",val)
  191. val3.Name = "time"
  192. val3.Value = repstor.TickTimer.Value
  193. end
  194. val.Parent = workspace.ValueChanger1
  195. end
  196.  
  197. function SnowballHit(part,pos,power)
  198. if part.Parent:findFirstChild("Humanoid") then
  199. local dmg = (45*power) - math.random(1,4)
  200. dmg = power > 0.99 and dmg*1.25 or dmg
  201. print("Damaging",part.Parent.Name,"by",dmg)
  202. part.Parent.Humanoid.Health = -dmg
  203. end
  204. SnowSplosion(pos)
  205. end
  206.  
  207. function SnowSplosion(pos)
  208. local spmdl = Instance.new("Model", char)
  209. spmdl.Name = "SnoSplosion"
  210. for i = 1, 14 do
  211. local p = P:Clone()
  212. p.Parent = spmdl
  213. p.Name = "Effect"
  214. p.Anchored = true
  215. p.BrickColor = BrickColor.new("White")
  216. p.CFrame = CFrame.new(pos) * CFrame.Angles(0,(math.pi*2)*math.random(),(math.pi*2)*math.random()) * CFrame.new(0.05,0,0)
  217. p.Transparency = 0.2
  218. local mesh = Instance.new("SpecialMesh",p)
  219. mesh.MeshType = "Sphere"
  220. mesh.Scale = Vector3.new(5,2,2)
  221. end
  222. table.insert(SnowSplosionEffects,spmdl)
  223. end
  224. ----------------------------------
  225.  
  226. ---- value setup ---------
  227.  
  228. local pose = Instance.new("IntValue", script)
  229. pose.Name = "pose"
  230. pose.Value = 0
  231. local invoke = Instance.new("IntValue", script)
  232. invoke.Name = "invoke"
  233. invoke.Value = 0
  234. local snowballs = Instance.new("IntValue", script)
  235. snowballs.Name = "snowballs"
  236. snowballs.Value = 8
  237. local Main = Instance.new("ObjectValue", script)
  238. Main.Name = "Main"
  239.  
  240. for i, v in pairs(char:GetChildren()) do
  241. if v.Name == "health" and v.className == "NumberValue" then
  242. v:Destroy()
  243. end
  244. end
  245. local health = Instance.new("NumberValue", char)
  246. health.Name = "health"
  247. health.Value = 100
  248. health.Changed:connect(function()
  249. if health.Value <= 0 then
  250. char:BreakJoints()
  251. end
  252. end)
  253.  
  254. snowballs.Changed:connect(function()
  255. snowballs.Value = snowballs.Value > 8 and 8 or snowballs.Value
  256. snowballs.Value = snowballs.Value < 0 and 0 or snowballs.Value
  257. local percentage = snowballs.Value/8
  258. SnowPart.Mesh.Scale = Vector3.new(0.71,0.6*percentage,0.71) *5
  259. SnowPart.Weld.C0 = CFrame.new(0,-0.08 - (0.3*(1-percentage)),0)
  260. SnowPart.Transparency = percentage == 0 and 1 or 0
  261. end)
  262.  
  263. player.Chatted:connect(function(msg)
  264. if string.sub(msg:lower(),1,5) == "pose/" then
  265. pose.Value = tonumber(string.sub(msg,6))
  266. elseif string.sub(msg:lower(),1,7) == "invoke/" then
  267. invoke.Value = tonumber(string.sub(msg,8))
  268. elseif msg == "replenish" then
  269. snowballs.Value = 8
  270. end
  271. end)
  272.  
  273. ------ designs -------------
  274. function Build()
  275. for i, v in pairs(char:children()) do
  276. if v.Name == "Mozzarella" then
  277. v:Destroy()
  278. end
  279. end
  280. local m = Instance.new("Model", script)
  281. m.Name = "Mozzarella"
  282.  
  283. local b = P:Clone()
  284. b.Parent = m
  285. b.Name = "Bag"
  286. b.BrickColor = BrickColor.new("Lime green")
  287. b.Transparency = 1
  288. local mesh = Instance.new("SpecialMesh",b)
  289. mesh.MeshType = "Brick"
  290. mesh.Scale = Vector3.new(0.8,0.6,0.8) *5
  291. local w = Instance.new("Weld",b)
  292. w.Part0 = RL
  293. w.Part1 = b
  294. w.C0 = CFrame.new(0.82,0.5,0)
  295.  
  296. for i = 1, 10 do
  297. local p = P:Clone()
  298. p.Parent = m
  299. p.Name = "BagPart"
  300. p.BrickColor = BrickColor.new("Dark orange")
  301. p.Material = "Fabric"
  302. local mesh = Instance.new("SpecialMesh",p)
  303. mesh.MeshType = "Brick"
  304. mesh.Scale = Vector3.new(0.1,0.4,0.26) *5
  305. local w = Instance.new("Weld",p)
  306. w.Part0 = b
  307. w.Part1 = p
  308. w.C1 = CFrame.new(0.35,0.004*(i%2),0)
  309. w.C0 = CFrame.new(0,0.1,0) * CFrame.Angles(0,math.pi*2/10*i,0)
  310.  
  311. if i%2 == 0 then
  312. for j = 0, 6 do
  313. local mathi = math.sin(math.pi/2 + (math.pi/5*j))
  314. local p = P:Clone()
  315. p.Parent = m
  316. p.Name = "BagPart"
  317. p.BrickColor = BrickColor.new("Dark orange")
  318. p.Material = "Fabric"
  319. local mesh = Instance.new("SpecialMesh",p)
  320. mesh.MeshType = "Brick"
  321. mesh.Scale = Vector3.new(0.1,0.22,0.26*mathi) *5
  322. local w = Instance.new("Weld",p)
  323. w.Part0 = b
  324. w.Part1 = p
  325. w.C1 = CFrame.new(0.35,0,0)
  326. w.C0 = CFrame.new(0,-0.2,0) * CFrame.Angles(0,math.pi*2/10*i,math.pi/6*j)
  327. end
  328. end
  329. end
  330.  
  331. local s = P:Clone()
  332. s.Parent = m
  333. s.Name = "Snow"
  334. s.BrickColor = BrickColor.new("White")
  335. s.Transparency = 0
  336. s.Material = "Sand"
  337. local mesh = Instance.new("CylinderMesh",s)
  338. mesh.Scale = Vector3.new(0.71,0.6,0.71) *5
  339. local w = Instance.new("Weld",s)
  340. w.Part0 = b
  341. w.Part1 = s
  342. w.C0 = CFrame.new(0,-0.08,0)
  343. SnowPart = s
  344.  
  345. end
  346. Build()
  347. --------------------------------
  348.  
  349.  
  350. -------------- snowball power charge gui ----------------------------
  351. function CreateGui()
  352. for i, v in pairs(Gui:GetChildren()) do
  353. if v.Name == "SnowballPower" then
  354. v:Destroy()
  355. end
  356. end
  357. local g = Instance.new("ScreenGui", Gui)
  358. g.Name = "SnowballPower"
  359. local f = Instance.new("Frame",g)
  360. f.Name = "Container"
  361. f.Size = UDim2.new(0,30,0,110)
  362. f.Position = UDim2.new(1,10,0.5,-55)
  363. f.Transparency = 0
  364. f.BackgroundColor3 = Color3.new(0.45,0.35,0.25)
  365. f.BorderColor3 = Color3.new(0.55,0.45,0.35)
  366. f.BorderSizePixel = 3
  367. f.Archivable = false
  368. f.ZIndex = 0
  369. SPC = f
  370. local b = Instance.new("Frame",f)
  371. b.Name = "Backing"
  372. b.Size = UDim2.new(0,20,0,100)
  373. b.Position = UDim2.new(0.5,-10,0.5,-50)
  374. b.BorderSizePixel = 0
  375. b.BackgroundColor3 = Color3.new(0.1,0.45,0.01)
  376. b.ZIndex = 1
  377. SPB = b
  378. local fr = b:Clone()
  379. fr.Parent = b
  380. fr.Size = UDim2.new(1,0,0.5,0)
  381. fr.Position = UDim2.new(0,0,0.5,0)
  382. fr.BackgroundColor3 = Color3.new(0.1,0.65,0.01)
  383. SPF = fr
  384.  
  385. end
  386. CreateGui()
  387.  
  388. -------------- limb setup ---------------
  389. pcall(function() char.Animate:Destroy() end)
  390.  
  391. SetWeld(RS,1,1,NV,NV,Vector3.new(1.5,0.5,0),NV)
  392. RS.C1 = CFrame.new(0,0.5,0)
  393.  
  394. SetWeld(LS,1,1,NV,NV,Vector3.new(-1.5,0.5,0),NV)
  395. LS.C1 = CFrame.new(0,0.5,0)
  396.  
  397. SetWeld(RH,1,1,NV,NV,Vector3.new(0.5,-1,0),NV)
  398. RH.C1 = CFrame.new(0,1,0)
  399.  
  400. SetWeld(LH,1,1,NV,NV,Vector3.new(-0.5,-1,0),NV)
  401. LH.C1 = CFrame.new(0,1,0)
  402.  
  403. SetWeld(N,1,1,NV,NV,Vector3.new(0,1,0),NV)
  404. N.C1 = CFrame.new(0,-0.5,0)
  405.  
  406. SetWeld(HRJ,1,1,NV,NV,NV,NV)
  407. HRJ.C1 = CFrame.new(0,0,0)
  408.  
  409. wait(1)
  410. RS.MaxVelocity = 0
  411. RS.CurrentAngle = 0
  412. RS.DesiredAngle = 0
  413. LS.MaxVelocity = 0
  414. LS.CurrentAngle = 0
  415. LS.DesiredAngle = 0
  416. RH.MaxVelocity = 0
  417. RH.CurrentAngle = 0
  418. RH.DesiredAngle = 0
  419. LH.MaxVelocity = 0
  420. LH.CurrentAngle = 0
  421. LH.DesiredAngle = 0
  422. N.MaxVelocity = 0
  423. N.CurrentAngle = 0
  424. N.DesiredAngle = 0
  425. HRJ.MaxVelocity = 0
  426. HRJ.CurrentAngle = 0
  427. HRJ.DesiredAngle = 0
  428.  
  429. -----------------
  430.  
  431. ----- value changed connections ----
  432. Main.Changed:connect(function()
  433. if Main.Value ~= nil then
  434. main,maina = GetWeld(Main.Value)
  435. else
  436. main,maina = nil,nil
  437. end
  438. end)
  439.  
  440. Hu.Changed:connect(function()
  441. if disableJump or DisableMovement then
  442. Hu.Jump = false
  443. end
  444. end)
  445.  
  446. ------- Keys & Mouse ---------------
  447. function B1D()
  448. MouseDown = true
  449. if not Animating then
  450. script.invoke.Value = 1
  451. else
  452. while Animating do
  453. wait()
  454. end
  455. if MouseDown then
  456. script.invoke.Value = 1
  457. end
  458. end
  459. end
  460. function B1U()
  461. MouseDown = false
  462. end
  463. mouse.Button1Down:connect(B1D)
  464. mouse.Button1Up:connect(B1U)
  465.  
  466. function KD(key)
  467. if key == "0" then
  468. Shift = true
  469. if pose.Value == 1 then
  470. pose.Value = 0
  471. disableJump = false
  472. end
  473. elseif key == "4" then
  474. Alt = true
  475. if not Animating and SlideCooldown == 0 then
  476. invoke.Value = 3
  477. else
  478. while Animating or SlideCooldown > 0 do
  479. wait()
  480. end
  481. if Alt then
  482. invoke.Value = 3
  483. end
  484. end
  485. elseif key == "2" then
  486. if not ThrowingSequence then
  487. if pose.Value == 0 then
  488. pose.Value = 1
  489. disableJump = true
  490. elseif pose.Value == 1 then
  491. pose.Value = 0
  492. disableJump = false
  493. end
  494. end
  495. elseif key == string.char(32) then
  496. Space = true
  497. if pose.Value == 1 then
  498. if not Animating then
  499. invoke.Value = 2
  500. else
  501. while Animating do
  502. wait()
  503. end
  504. if Space and pose.Value == 1 then
  505. invoke.Value = 2
  506. end
  507. end
  508. end
  509. end
  510. end
  511.  
  512. function KU(key)
  513. if key == "0" then
  514. Shift = false
  515. elseif key == "4" then
  516. Alt = false
  517. elseif key == string.char(32) then
  518. Space = false
  519. end
  520. end
  521.  
  522. mouse.KeyDown:connect(KD)
  523. mouse.KeyUp:connect(KU)
  524.  
  525. local count1 = 0
  526. local angle = 0
  527. local slidecount = 1
  528. local slidecountmax = 1
  529. local countspeed = 0.5
  530. local cancella = false
  531. local cancelra = false
  532. local cancelrl = false
  533. local cancelll = false
  534. local canceln = false
  535. local cancelhrp = false
  536. local cancelmain = false
  537. local anim = 0
  538. local lastanim = -1
  539. local lastpose = 0
  540. local rs,rsa, ls,lsa, rh,rha, lh,lha, n,na, hrj,hrja, main,maina
  541. local ghitz,genz
  542. local prevvelocity = HRP.Velocity
  543.  
  544. function UpdateWP(max,sped)
  545. max = max or 5
  546. sped = sped or AnimSpeeds[anim+1]
  547. rs,rsa = GetWeld(RS)
  548. ls,lsa = GetWeld(LS)
  549. rh,rha = GetWeld(RH)
  550. lh,lha = GetWeld(LH)
  551. n,na = GetWeld(N)
  552. hrj,hrja = GetWeld(HRJ)
  553. if Main.Value ~= nil then
  554. main,maina = GetWeld(Main.Value)
  555. end
  556. slidecount = 0
  557. slidecountmax = max
  558. countspeed = sped
  559. end
  560.  
  561. UpdateWP()
  562. -------------- Invoke Animations -------------------------
  563. function Throw()
  564. if not Animating and snowballs.Value > 0 then
  565. Animating = true
  566. ThrowingSequence = true
  567. pose.Value = 0
  568. disableJump = false
  569. ----- sword slash ------
  570. cancelra = true
  571. cancella = true
  572. cancelhrp = true
  573. canceln = true
  574. cancelmain = true
  575. local prevslidecount = slidecount
  576. UpdateWP(slidecountmax,countspeed)
  577. slidecount = prevslidecount
  578.  
  579. local phase = 0
  580. local smdl = Instance.new("Model",char)
  581. smdl.Name = "SnowBall"
  582. local ball,weld
  583. for i = 1, 17 do
  584. if MouseDown then
  585. if i <= 7 then
  586. SetWeld(N,i,7,n,na,Vector3.new(0,1,0),Vector3.new(-0.3,-math.pi/8,0))
  587. SetWeld(HRJ,i,7,hrj,hrja,Vector3.new(0,0,0.1),Vector3.new(0,-math.pi/20,0))
  588. SetWeld(RS,i,7,rs,rsa,Vector3.new(1.5,0.26,0),Vector3.new(-0.2,0,-0.1))
  589. SetWeld(LS,i,7,ls,lsa,Vector3.new(-1.5,0.525,-0.01),Vector3.new(-0.25,0,-0.12))
  590. phase = 1
  591. if i == 7 then
  592. UpdateWP(slidecountmax,countspeed)
  593. ChangeValue(snowballs,"Increment",-1)
  594. ball = P:Clone()
  595. ball.Parent = smdl
  596. ball.BrickColor = BrickColor.new("White")
  597. ball.Material = "Sand"
  598. local mesh = Instance.new("SpecialMesh",ball)
  599. mesh.MeshType = "Sphere"
  600. mesh.Scale = Vector3.new(0.8,0.8,0.8) *5
  601. weld = Instance.new("Weld",ball)
  602. weld.Part0 = RA
  603. weld.Part1 = ball
  604. weld.C0 = CFrame.new(0,-1.3,0)
  605. end
  606. else
  607. SetWeld(N,i-7,10,n,na,Vector3.new(0,1,0),Vector3.new(0.03,math.pi/9,0))
  608. SetWeld(HRJ,i-7,10,hrj,hrja,Vector3.new(0,0,0.1),Vector3.new(0,-math.pi/8,0))
  609. SetWeld(RS,i-7,10,rs,rsa,Vector3.new(1.4,0.5,0),Vector3.new(math.pi*1.05,0,0.2))
  610. SetWeld(LS,i-7,10,ls,lsa,Vector3.new(-1.3,0.42,-0.1),Vector3.new(math.pi/4,0,-math.pi/8))
  611. if i == 9 then
  612. SPC.Archivable = true
  613. SPB.BackgroundColor3 = Color3.new(0.45,0.1,0.01)
  614. SPF.BackgroundColor3 = Color3.new(0.65,0.1,0.01)
  615. SPF.Size = UDim2.new(1,0,0,0)
  616. SPF.Position = UDim2.new(0,0,1,0)
  617. end
  618. phase = 2
  619. end
  620. wait(0.02)
  621. end
  622. end
  623. local rs2,rsa2 = GetWeld(RS)
  624. local ls2,lsa2 = GetWeld(LS)
  625. local n2,na2 = GetWeld(N)
  626. local hrj2,hrja2 = GetWeld(HRJ)
  627.  
  628. local powercounter = 20
  629. local power = 0
  630. while MouseDown do
  631. powercounter = (powercounter%40) + 1
  632. power = 1 - math.sin(math.pi/40*powercounter)
  633. SPB.BackgroundColor3 = Color3.new((1-power)*0.35 +0.1,power*0.35 +0.1,0.01)
  634. SPF.BackgroundColor3 = Color3.new((1-power)*0.55 +0.1,power*0.55 +0.1,0.01)
  635. SPF.Size = UDim2.new(1,0,power,0)
  636. SPF.Position = UDim2.new(0,0,1-power,0)
  637. SetWeld(RS,power,1,rs2,rsa2,Vector3.new(1.4,0.6,0.05),Vector3.new(math.pi*1.17,0,0.3))
  638. SetWeld(LS,power,1,ls2,lsa2,Vector3.new(-1.3,0.42,-0.16),Vector3.new(math.pi/2.45,0,-math.pi/5))
  639. SetWeld(N,power,1,n2,na2,Vector3.new(0,1,0),Vector3.new(0.07,math.pi/8,-0.04))
  640. SetWeld(HRJ,power,1,hrj2,hrja2,Vector3.new(0,0,0.1),Vector3.new(0,-math.pi/7,0))
  641. phase = 3
  642. wait(0.02)
  643. end
  644. SPC.Archivable = false
  645. print("Phase:",phase)
  646. rs2,rsa2 = GetWeld(RS)
  647. ls2,lsa2 = GetWeld(LS)
  648. n2,na2 = GetWeld(N)
  649. hrj2,hrja2 = GetWeld(HRJ)
  650.  
  651. if phase == 1 or phase == 2 then
  652. smdl:Destroy()
  653. ChangeValue(snowballs,"Increment",1)
  654. elseif phase == 3 then
  655. print("Throwing with "..string.sub(tostring(power*100),1,5).."% power!")
  656. local mousepos = mouse.Hit.p
  657. for i = 1, 8 do
  658. SetWeld(RS,i,8,rs2,rsa2,Vector3.new(1.4,0.6,0.05),Vector3.new((math.pi*0.6) -(1.8*power),0.18 - (0.65*power),0.3))
  659. SetWeld(LS,i,8,ls2,lsa2,Vector3.new(-1.36,0.5,-0.06),Vector3.new((-math.pi/4) - (0.4*power),0.2,-math.pi/5))
  660. SetWeld(N,i,8,n2,na2,Vector3.new(0,1,0),Vector3.new(-0.07,-math.pi/11 - (0.3*power),-0.04))
  661. SetWeld(HRJ,i,8,hrj2,hrja2,Vector3.new(0,0,0.1),Vector3.new(0,(math.pi/10)+(0.3*power),0))
  662. if i == 2 then
  663. weld:Destroy()
  664. ball.Anchored = true
  665. --- {part,gravity,currentgravity,direction,speed,power,counter,{parts},life}
  666. local snowball = {ball,0.1 + 0.8*(0.96-power),1 - (0.95*power),(mousepos-ball.Position).unit,1.8 + (3*power),power,1,{},0}
  667. if power > 0.99 then
  668. for i = 1, 20 do
  669. local p = P:Clone()
  670. p.Anchored = true
  671. p.BrickColor = BrickColor.new("Bright yellow")
  672. local mesh = Instance.new("SpecialMesh",p)
  673. mesh.MeshId = "rbxassetid://9756362"
  674. mesh.Scale = Vector3.new(0.32,0.32,0.32)
  675. table.insert(snowball[8],p)
  676. end
  677. end
  678. table.insert(SnowballProjectiles,snowball)
  679. end
  680. wait(0.02)
  681. end
  682. wait(0.02)
  683. else
  684. smdl:Destroy()
  685. end
  686.  
  687. UpdateWP(slidecountmax,countspeed)
  688. cancelra = false
  689. cancella = false
  690. cancelhrp = false
  691. canceln = false
  692. cancelmain = false
  693.  
  694. ThrowingSequence = false
  695. Animating = false
  696. elseif snowballs.Value <= 0 then
  697. print("No snow left!")
  698. -- alert saying you have no snow left in pouch
  699. end
  700. end
  701.  
  702. function DiveRoll()
  703. if not Animating then
  704. Animating = true
  705. DisableMovement = true
  706. cancelra = true
  707. cancella = true
  708. cancelhrp = true
  709. canceln = true
  710. cancelmain = true
  711. cancelll = true
  712. cancelrl = true
  713. local prevslidecount = slidecount
  714. UpdateWP(slidecountmax,countspeed)
  715. slidecount = prevslidecount
  716.  
  717. local bv = Instance.new("BodyVelocity", HRP)
  718. bv.maxForce = Vector3.new(1/0,0,1/0)
  719. bv.velocity = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z)).lookVector * 28
  720. local bg = Instance.new("BodyGyro", HRP)
  721. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  722. bg.cframe = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z))
  723. bg.D = 100
  724. game:GetService("Debris"):AddItem(bv,2.5)
  725. game:GetService("Debris"):AddItem(bg,2.5)
  726.  
  727. local connex = game:GetService("RunService").RenderStepped:connect(function()
  728. if HRP.Velocity.y > 0 then
  729. HRP.Velocity = NV
  730. end
  731. HRP.CanCollide = false
  732. end)
  733. local connex2 = game:GetService("RunService").Stepped:connect(function()
  734. local Ghitz,Genz = RAY(HRP.Position,Vector3.new(0,-3.1,0))
  735. if Ghitz then
  736. HRP.CFrame = (HRP.CFrame - HRP.Position) + Genz + Vector3.new(0,3,0)
  737. end
  738. end)
  739.  
  740. local animspd = 4
  741. for i = 1, animspd do
  742. SetWeld(N,i,animspd,n,na,Vector3.new(0,1,0),Vector3.new(math.pi/5,0,0),0)
  743. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,0.4,0),Vector3.new(-math.pi/2.6,0,0),0)
  744. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/1.2,0,0.2),0)
  745. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/1.2,0,-0.2),0)
  746. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-0.6,-0.1),Vector3.new(0.1,0,0.05),0)
  747. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-0.6,-0.1),Vector3.new(0.1,0,-0.05),0)
  748. wait(0.02)
  749. end
  750. UpdateWP(slidecountmax,countspeed)
  751. for i = 1, animspd do
  752. SetWeld(N,i,animspd,n,na,Vector3.new(0,1,0),Vector3.new(math.pi/12,0,0),0)
  753. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new(-math.pi/1.5,0,0),0)
  754. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.6,-0.06),Vector3.new(math.pi/1.3,0,0.2),0)
  755. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.6,-0.06),Vector3.new(math.pi/1.3,0,-0.2),0)
  756. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-1,0),Vector3.new(-0.1,0,0.05),0)
  757. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-1,0),Vector3.new(-0.1,0,-0.05),0)
  758. wait(0.02)
  759. end
  760. UpdateWP(slidecountmax,countspeed)
  761. for i = 1, animspd do
  762. SetWeld(N,i,animspd,n,na,Vector3.new(0,0.85,0),Vector3.new(-math.pi/4,0,0),0)
  763. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-1,0),Vector3.new(-math.pi*0.9,0,0),0)
  764. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/1.4,0,0.08),0)
  765. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/1.4,0,-0.08),0)
  766. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-0.3,-0.4),Vector3.new(-0.12,0,0.05),0)
  767. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-0.3,-0.4),Vector3.new(-0.12,0,-0.05),0)
  768. wait(0.02)
  769. end
  770. UpdateWP(slidecountmax,countspeed)
  771. bv.velocity = bv.velocity * 0.9
  772. for i = 1, animspd do
  773. SetWeld(N,i,animspd,n,na,Vector3.new(0,0.85,0),Vector3.new(-math.pi/3.5,0,0),0)
  774. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-1.25,0),Vector3.new(-math.pi*1.1,0,0),0)
  775. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/1.8,0,-0.1),0)
  776. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/1.8,0,0.1),0)
  777. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,0.2,-0.7),Vector3.new(-0.12,0,0.05),0)
  778. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,0.2,-0.7),Vector3.new(-0.12,0,-0.05),0)
  779. wait(0.02)
  780. end
  781. UpdateWP(slidecountmax,countspeed)
  782. for i = 1, animspd do
  783. SetWeld(N,i,animspd,n,na,Vector3.new(0,0.85,0),Vector3.new(-math.pi/3.7,0,0),0)
  784. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-2.3,0),Vector3.new(-math.pi*1.55,0,0),0)
  785. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/2.4,0,-0.23),0)
  786. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/2.4,0,0.23),0)
  787. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,0.1,-0.7),Vector3.new(-0.1,0,0.04),0)
  788. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,0.1,-0.7),Vector3.new(-0.1,0,-0.04),0)
  789. wait(0.02)
  790. end
  791. UpdateWP(slidecountmax,countspeed)
  792. bv.velocity = bv.velocity * 0.7
  793. for i = 1, animspd do
  794. SetWeld(N,i,animspd,n,na,Vector3.new(0,1.05,0),Vector3.new(-0.4,0,0),0)
  795. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-1.6,0),Vector3.new(-math.pi*1.85,0,0),0)
  796. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/3.2,0,-0.24),0)
  797. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/3.2,0,0.24),0)
  798. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-0.08,-0.6),Vector3.new(-0.22,0,0.04),0)
  799. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-0.08,-0.6),Vector3.new(-0.22,0,-0.04),0)
  800. wait(0.02)
  801. end
  802. UpdateWP(slidecountmax,countspeed)
  803. bv.velocity = bv.velocity * 0.4
  804. for i = 1, animspd do
  805. SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),-0.22,0.446 + (angle*0.016)),0)
  806. SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),0.22,-0.446 - (angle*0.016)),0)
  807. SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.7,-0.18 - (cangle*0.04),-0.2 - (angle*0.01)),Vector3.new(0.2 - (angle*0.12),-math.pi/5,0.12 - (angle*0.06)),0)
  808. SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.38,-0.32 + (cangle*0.04),-0.45 + (angle*0.01)),Vector3.new(-0.1 + (angle*0.15),-math.pi/5,-0.07 + (angle*0.07)),0)
  809. SetWeld(N,i,animspd,n,na,Vector3.new(0,1,0),Vector3.new(0.12 + (angle*0.004),-math.pi/5 - (angle*0.01),0.1),0)
  810. SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new((-math.pi*2) -0.24 + (-angle*0.008),math.pi/5 + (angle*0.01),angle*0.01),0)
  811. wait(0.02)
  812. end
  813.  
  814. SetWeld(HRJ,1,1,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new(-0.24 + (-angle*0.008),math.pi/5 + (angle*0.01),angle*0.01))
  815. bv:Destroy()
  816. bg:Destroy()
  817. connex:disconnect()
  818. connex2:disconnect()
  819.  
  820. UpdateWP()
  821. cancelra = false
  822. cancella = false
  823. cancelhrp = false
  824. canceln = false
  825. cancelmain = false
  826. cancelll = false
  827. cancelrl = false
  828. Animating = false
  829. DisableMovement = false
  830. end
  831. end
  832.  
  833. function Slide()
  834. if not Animating and Shift and pose.Value == 0 and SlideCooldown == 0 and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude >= 18 then
  835. Animating = true
  836. DisableMovement = true
  837. cancelra = true
  838. cancella = true
  839. cancelhrp = true
  840. canceln = true
  841. cancelmain = true
  842. cancelll = true
  843. cancelrl = true
  844. local prevslidecount = slidecount
  845. UpdateWP(slidecountmax,countspeed)
  846. slidecount = prevslidecount
  847.  
  848. local bv = Instance.new("BodyVelocity", HRP)
  849. bv.maxForce = Vector3.new(1/0,0,1/0)
  850. bv.velocity = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z)).lookVector * 30
  851. local bg = Instance.new("BodyGyro", HRP)
  852. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  853. bg.cframe = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z))
  854. bg.D = 100
  855. game:GetService("Debris"):AddItem(bv,5.5)
  856. game:GetService("Debris"):AddItem(bg,5.5)
  857.  
  858. local connex = game:GetService("RunService").RenderStepped:connect(function()
  859. if HRP.Velocity.y > 0 then
  860. HRP.Velocity = NV
  861. end
  862. HRP.CanCollide = false
  863. end)
  864.  
  865. local animspd = 8
  866. local animcount = 1
  867. local bvaccel = 1
  868. local bvvelo = bv.velocity
  869. local lasttorpos = HRP.Position
  870. local tickcount = 0
  871. local cancelslide = false
  872. local torsoangle = 0
  873. while not cancelslide and bvaccel > 0.16 do
  874. tickcount = tickcount+1
  875. lasttorpos = HRP.Position
  876. animcount = (animcount < animspd and animcount+1) or animspd
  877. local n2,na2 = GetWeld(N)
  878. local hrj2,hrja2 = GetWeld(HRJ)
  879. local rs2,rsa2 = GetWeld(RS)
  880. local ls2,lsa2 = GetWeld(LS)
  881. local rh2,rha2 = GetWeld(RH)
  882. local lh2,lha2 = GetWeld(LH)
  883. SetWeld(N,1,4,n2,na2,Vector3.new(0,1.08,-0.1),Vector3.new(-math.pi/4.3,-0.12,-0.08))
  884. SetWeld(HRJ,1,4,hrj2,hrja2,Vector3.new(0,-2.1,0),Vector3.new((math.pi/2.6)+torsoangle,0.12 + (angle*0.008),0))
  885. SetWeld(RS,1,4,rs2,rsa2,Vector3.new(1.4,0.6,-0.02),Vector3.new(-math.pi/1.8,-(angle*0.01),0.2 - (angle*0.009)))
  886. SetWeld(LS,1,4,ls2,lsa2,Vector3.new(-1.3,0.6,-0.16),Vector3.new(-math.pi/1.8,-(angle*0.01),-0.6 - (angle*0.009)))
  887. SetWeld(RH,1,4,rh2,rha2,Vector3.new(0.5,-0.8,0),Vector3.new(0.22,-0.06 - (angle*0.01),0.05))
  888. SetWeld(LH,1,4,lh2,lha2,Vector3.new(-0.5,-0.35,-0.45),Vector3.new(-0.25,-0.12 - (angle*0.01),-0.03))
  889. bv.velocity = bvvelo * bvaccel
  890. wait(0.02)
  891. local torsoatan = (CFrame.new(lasttorpos) * (HRP.CFrame-HRP.Position)):pointToObjectSpace(HRP.Position)
  892. torsoangle = math.atan2(torsoatan.y,-torsoatan.z)
  893. local Ghitz,Genz = RAY(HRP.Position,Vector3.new(0,-3.1,0))
  894. if Ghitz then
  895. HRP.CFrame = (HRP.CFrame - HRP.Position) + Genz + Vector3.new(0,3,0)
  896. end
  897. if (lasttorpos.y - HRP.Position.y) < -0.1 then
  898. bvaccel = bvaccel - 0.045
  899. elseif (lasttorpos.y - HRP.Position.y) > 0.08 then
  900. bvaccel = bvaccel - 0.006
  901. if Ghitz then
  902. bvaccel = bvaccel + ((lasttorpos.y - HRP.Position.y) /2.5)
  903. end
  904. else
  905. bvaccel = bvaccel - 0.017
  906. end
  907. bvaccel = bvaccel > 1.02 and 1.02 or bvaccel
  908. local chitz,cenz = RAY(Torsoz.Position,Vector3.new(0,2.5,0))
  909. local stationary = false
  910. if tickcount > 5 then
  911. stationary = (Vector3.new(lasttorpos.x,0,lasttorpos.z) - Vector3.new(HRP.Position.x,0,HRP.Position.z)).magnitude < 0.15
  912. end
  913. if bvaccel < 0.16 or (chitz == nil and not Alt) or stationary then
  914. cancelslide = true
  915. end
  916. end
  917.  
  918. SlideCooldown = 14
  919. bv:Destroy()
  920. bg:Destroy()
  921. connex:disconnect()
  922.  
  923. UpdateWP(slidecountmax,countspeed)
  924. cancelra = false
  925. cancella = false
  926. cancelhrp = false
  927. canceln = false
  928. cancelmain = false
  929. cancelll = false
  930. cancelrl = false
  931. Animating = false
  932. DisableMovement = false
  933. end
  934. end
  935.  
  936. invokelist = {}
  937. invokelist[1] = Throw
  938. invokelist[2] = DiveRoll
  939. invokelist[3] = Slide
  940. invoke.Changed:connect(function()
  941. if invoke.Value ~= 0 then
  942. local valu = invoke.Value
  943. invoke.Value = 0
  944. if invokelist[valu] ~= nil then
  945. invokelist[valu]()
  946. end
  947. end
  948. end)
  949.  
  950. -------------- Animation Tween Funcs ----------------------
  951. function Idle()
  952. if script.pose.Value == 0 then
  953. ----- regular --------
  954. if not cancelra then
  955. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(-0.1 + (angle*0.027),0,0.046 - (angle*0.021)))
  956. end
  957. if not cancella then
  958. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-0.1 + (angle*0.027),0,-0.046 + (angle*0.021)))
  959. end
  960. if not cancelrl then
  961. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-1,0),Vector3.new(-0.05 + (angle*0.018),0,0.01 - (angle*0.005)))
  962. end
  963. if not cancelll then
  964. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-1,0),Vector3.new(-0.05 + (angle*0.018),0,-0.01 + (angle*0.005)))
  965. end
  966. if not canceln then
  967. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.04 + (-angle*0.02),0,0))
  968. end
  969. if not cancelhrp then
  970. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(0.016 + (-angle*0.009),0,0))
  971. end
  972.  
  973. elseif script.pose.Value == 1 then
  974. ----- crouch --------
  975. if not cancelra then
  976. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.35,0.66 - (angle*0.012),0.12),Vector3.new(-0.1 + (angle*0.015),-0.22,0.446 - (angle*0.016)))
  977. end
  978. if not cancella then
  979. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.35,0.66 - (angle*0.012),0.12),Vector3.new(-0.1 + (angle*0.015),0.22,-0.446 + (angle*0.016)))
  980. end
  981. if not cancelrl then
  982. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.55,-1.05,-0.47 - (angle*0.006)),Vector3.new(-math.pi/2.2 + (angle*0.005),-math.pi/15,0.01 + (angle*0.005)))
  983. end
  984. if not cancelll then
  985. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,0.3,-0.55),Vector3.new(0.3 + (angle*0.01),-math.pi/12,0.08 + (angle*0.005)))
  986. end
  987. if not canceln then
  988. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.12 + (angle*0.004),-math.pi/5,0.1))
  989. end
  990. if not cancelhrp then
  991. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,-1.4,0),Vector3.new(-0.16 + (-angle*0.007),math.pi/5,0))
  992. end
  993.  
  994. elseif script.pose.Value == 2 then
  995.  
  996. end
  997. end
  998.  
  999. function Walking()
  1000. if script.pose.Value == 0 then
  1001. ----- regular --------
  1002. if not cancelra then
  1003. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(angle*0.2,0,-math.abs(angle*0.02)))
  1004. end
  1005. if not cancella then
  1006. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-angle*0.2,0,math.abs(angle*0.02)))
  1007. end
  1008. if not cancelrl then
  1009. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-1,0),Vector3.new(-angle*0.17,0,math.abs(angle*0.005)))
  1010. end
  1011. if not cancelll then
  1012. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-1,0),Vector3.new(angle*0.17,0,-math.abs(angle*0.005)))
  1013. end
  1014. if not canceln then
  1015. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.015 ,-angle*0.01,0))
  1016. end
  1017. if not cancelhrp then
  1018. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.015 - math.abs((angle*0.02)),angle*0.01,0))
  1019. end
  1020. if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
  1021. SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
  1022. end
  1023.  
  1024. elseif script.pose.Value == 1 then
  1025. ----- crouch --------
  1026. if not cancelra then
  1027. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),-0.22,0.446 + (angle*0.016)))
  1028. end
  1029. if not cancella then
  1030. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),0.22,-0.446 - (angle*0.016)))
  1031. end
  1032. if not cancelrl then
  1033. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.7,-0.18 - (cangle*0.04),-0.2 - (angle*0.01)),Vector3.new(0.2 - (angle*0.12),-math.pi/5,0.12 - (angle*0.06)))
  1034. end
  1035. if not cancelll then
  1036. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.38,-0.32 + (cangle*0.04),-0.45 + (angle*0.01)),Vector3.new(-0.1 + (angle*0.15),-math.pi/5,-0.07 + (angle*0.07)))
  1037. end
  1038. if not canceln then
  1039. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.12 + (angle*0.004),-math.pi/5 - (angle*0.01),0.1))
  1040. end
  1041. if not cancelhrp then
  1042. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new(-0.24 + (-angle*0.008),math.pi/5 + (angle*0.01),angle*0.01))
  1043. end
  1044.  
  1045. elseif script.pose.Value == 2 then
  1046.  
  1047. end
  1048. end
  1049.  
  1050. function Running()
  1051. if script.pose.Value == 0 then
  1052. ----- regular --------
  1053. if not cancelra then
  1054. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5 - math.abs(angle*0.035),0.5 - math.abs(angle*0.02),0),Vector3.new(0.16 + (angle*0.42),0,-math.abs(angle*0.07)))
  1055. end
  1056. if not cancella then
  1057. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5 + math.abs(angle*0.035),0.5 - math.abs(angle*0.02),0),Vector3.new(0.16 + (-angle*0.42),0,math.abs(angle*0.07)))
  1058. end
  1059. if not cancelrl then
  1060. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-1 + math.abs(angle*0.05),0),Vector3.new(-angle*0.3,0,math.abs(angle*0.005)))
  1061. end
  1062. if not cancelll then
  1063. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-1 + math.abs(angle*0.05),0),Vector3.new(angle*0.3,0,-math.abs(angle*0.005)))
  1064. end
  1065. if not canceln then
  1066. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.07 + math.abs(-angle*0.02),-angle*0.03,0))
  1067. end
  1068. if not cancelhrp then
  1069. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.14 - math.abs(-angle*0.04),angle*0.035,NV))
  1070. end
  1071. if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
  1072. SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
  1073. end
  1074.  
  1075. elseif script.pose.Value == 1 then
  1076.  
  1077. elseif script.pose.Value == 2 then
  1078.  
  1079. end
  1080. end
  1081.  
  1082.  
  1083. function Jumping()
  1084. if script.pose.Value == 0 then
  1085. ----- regular --------
  1086. if not cancelra then
  1087. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(-0.16,0,0.3 + (angle*0.012)))
  1088. end
  1089. if not cancella then
  1090. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-0.16,0,-0.3 - (angle*0.012)))
  1091. end
  1092. if not cancelrl then
  1093. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-0.8,-0.05),Vector3.new(-0.28 + (angle*0.02),0,0))
  1094. end
  1095. if not cancelll then
  1096. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-0.45,-0.55),Vector3.new(-0.4 - (angle*0.02),0,0))
  1097. end
  1098. if not canceln then
  1099. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-angle*0.01,0))
  1100. end
  1101. if not cancelhrp then
  1102. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(0.2 + (angle*0.002),angle*0.02,0))
  1103. end
  1104. if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
  1105. SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
  1106. end
  1107.  
  1108. elseif script.pose.Value == 1 then
  1109. ----- crouch --------
  1110. if not cancelra then
  1111. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(-0.16,0,0.3 + (angle*0.012)))
  1112. end
  1113. if not cancella then
  1114. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-0.16,0,-0.3 - (angle*0.012)))
  1115. end
  1116. if not cancelrl then
  1117. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.7,-0.8,-0.05),Vector3.new(-0.28 + (angle*0.001),-math.pi/6,-0.2))
  1118. end
  1119. if not cancelll then
  1120. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.3,-0.45,-0.55),Vector3.new(-0.4 - (angle*0.001),-math.pi/6,-0.2))
  1121. end
  1122. if not canceln then
  1123. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-math.pi/5 - (angle*0.01),0))
  1124. end
  1125. if not cancelhrp then
  1126. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.07 + (angle*0.002),math.pi/5 + (angle*0.02),0))
  1127. end
  1128. if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
  1129. SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
  1130. end
  1131.  
  1132. elseif script.pose.Value == 2 then
  1133.  
  1134. end
  1135. end
  1136.  
  1137. function Falling()
  1138. if script.pose.Value == 0 then
  1139. ----- regular --------
  1140. if not cancelra then
  1141. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(math.pi*1.1,0,-0.08 + (angle*0.012)))
  1142. end
  1143. if not cancella then
  1144. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(math.pi*1.1,0,0.08 - (angle*0.012)))
  1145. end
  1146. if not cancelrl then
  1147. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-0.45,-0.55),Vector3.new(-0.4 + (angle*0.02),0,0))
  1148. end
  1149. if not cancelll then
  1150. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-0.8,-0.05),Vector3.new(-0.28 - (angle*0.02),0,0))
  1151. end
  1152. if not canceln then
  1153. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-angle*0.01,0))
  1154. end
  1155. if not cancelhrp then
  1156. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.2 + (angle*0.002),angle*0.02,0))
  1157. end
  1158. if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
  1159. SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
  1160. end
  1161.  
  1162. elseif script.pose.Value == 1 then
  1163. ----- crouch --------
  1164. if not cancelra then
  1165. SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.65,0),Vector3.new(-0.1,0,0.3 + (angle*0.012)))
  1166. end
  1167. if not cancella then
  1168. SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.65,0),Vector3.new(-0.1,0,-0.3 - (angle*0.012)))
  1169. end
  1170. if not cancelrl then
  1171. SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.8,-0.1,-0.25),Vector3.new(-0.28 + (angle*0.001),-math.pi/6,-0.2))
  1172. end
  1173. if not cancelll then
  1174. SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.3,-0.8,-0.55),Vector3.new(-0.4 - (angle*0.001),-math.pi/6,-0.2))
  1175. end
  1176. if not canceln then
  1177. SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-math.pi/5 - (angle*0.01),0))
  1178. end
  1179. if not cancelhrp then
  1180. SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.07 + (angle*0.002),math.pi/5 + (angle*0.02),0))
  1181. end
  1182. if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
  1183. SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
  1184. end
  1185.  
  1186. elseif script.pose.Value == 2 then
  1187.  
  1188. end
  1189. end
  1190.  
  1191. game:GetService("RunService").Stepped:connect(function()
  1192. count1 = (count1%100) + countspeed
  1193. angle = math.pi * math.sin(math.pi*2/100*count1)
  1194. cangle = math.pi * math.cos(math.pi*2/100*count1)
  1195.  
  1196. ------------- snowball power gui movement ------------------
  1197. if SPC.Archivable == true then
  1198. SPCP = SPCP ~= 14 and SPCP+1 or 14
  1199. else
  1200. SPCP = SPCP ~= 0 and SPCP-1 or 0
  1201. end
  1202. if SPC ~= nil then
  1203. local perc = math.sin((math.pi/2/14)*SPCP)
  1204. SPC.Position = UDim2.new(1,10 - (50*perc),0.5,-55)
  1205. if SPCP > 0 then
  1206. SPC.Visible = true
  1207. else
  1208. SPC.Visible = false
  1209. end
  1210. end
  1211.  
  1212. ------------- walkspeed changes -------------------------
  1213. if DisableMovement then
  1214. Walkspeed = 0
  1215. Hu.WalkSpeed = Walkspeed
  1216. else
  1217. if Shift and pose.Value ~= 1 then
  1218. Walkspeed = 50
  1219. Hu.WalkSpeed = Walkspeed
  1220. else
  1221. Walkspeed = 16
  1222. if pose.Value == 1 then
  1223. Hu.WalkSpeed = Walkspeed/2
  1224. else
  1225. Hu.WalkSpeed = Walkspeed
  1226. end
  1227. end
  1228. end
  1229.  
  1230. -------- animation slide count and pose smoothener --------------------
  1231. slidecount = (slidecount < slidecountmax and slidecount+1) or slidecountmax
  1232. SlideCooldown = (SlideCooldown > 0 and SlideCooldown-1) or 0
  1233.  
  1234. if script.pose.Value ~= lastpose then
  1235. UpdateWP()
  1236. end
  1237.  
  1238. --------- animation conditions -------------------
  1239.  
  1240. local ghitz, genz = RAY(Torsoz.Position,Vector3.new(0,-5.2,0))
  1241.  
  1242. if ghitz == nil and Torsoz.Velocity.y > 1 then
  1243. ----- jumping -----
  1244. anim = 3
  1245. if anim ~= lastanim then
  1246. UpdateWP(7)
  1247. end
  1248. Jumping()
  1249. elseif ghitz == nil and Torsoz.Velocity.y < -1 then
  1250. ----- falling ------
  1251. anim = 4
  1252. if anim ~= lastanim then
  1253. UpdateWP(7)
  1254. end
  1255. Falling()
  1256. elseif Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude < 2 then
  1257. ---- idle ---------
  1258. anim = 0
  1259. if anim ~= lastanim then
  1260. UpdateWP(6)
  1261. end
  1262. Idle()
  1263.  
  1264. elseif Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude < 17 then
  1265. ---- walking -------
  1266. anim = 1
  1267. if anim ~= lastanim then
  1268. UpdateWP(7)
  1269. end
  1270. Walking()
  1271.  
  1272. elseif Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude >= 17 then
  1273. ----- running -----
  1274. anim = 2
  1275. if anim ~= lastanim then
  1276. UpdateWP(5)
  1277. end
  1278. Running()
  1279.  
  1280. ------------
  1281. end
  1282.  
  1283. --------- breakfall roll --------
  1284. if ghitz ~= nil and prevvelocity.y < -110 then
  1285. invoke.Value = 2
  1286. end
  1287.  
  1288. --------- snowball projectile movement --------
  1289. for i, v in pairs(SnowballProjectiles) do
  1290. local oldpos = v[1].Position
  1291. v[1].CFrame = v[1].CFrame + (v[4]*v[5]) + Vector3.new(0,v[3],0)
  1292. local raydist = (v[1].Position-oldpos).unit*((oldpos-v[1].Position).magnitude+0.5)
  1293. local hitz,enz = RAY(v[1].Position,raydist)
  1294.  
  1295. v[3] = v[3] - 0.35*v[2]
  1296. v[9] = v[9] +1
  1297.  
  1298. if #v[8] > 0 then
  1299. v[8][v[7]].Parent = v[1].Parent
  1300. v[8][v[7]].Transparency = 0.5 - (0.3 * math.random())
  1301. v[8][v[7]].Mesh.Scale = Vector3.new(0.45,0.45,0.45) - (Vector3.new(0.3,0.3,0.3) * math.random())
  1302. v[8][v[7]].CFrame = CFrame.new(oldpos,v[1].Position) * CFrame.Angles(0,0,(math.pi*2)/(math.random(1,100)/100)) * CFrame.new(math.random(1,10)/20,0,0)
  1303. v[7] = (v[7]%#v[8]) +1
  1304. for j,vv in pairs(v[8]) do
  1305. vv.CFrame = vv.CFrame * CFrame.new(0.05,0,0) * CFrame.Angles(0,-0.1,-0.085)
  1306. end
  1307. end
  1308.  
  1309. if hitz ~= nil or v[9] >= 200 then
  1310. if hitz ~= nil then
  1311. SnowballHit(hitz,enz,v[6])
  1312. end
  1313. v[1].Parent:Destroy()
  1314. print("Removed Snowball#",i)
  1315. table.remove(SnowballProjectiles,i)
  1316. end
  1317.  
  1318. end
  1319.  
  1320. ------ snowball splosion effects -----
  1321. for i, v in pairs(SnowSplosionEffects) do
  1322. for j,vv in pairs(v:GetChildren()) do
  1323. vv.CFrame = vv.CFrame * CFrame.new(0.3,0,0)
  1324. vv.Transparency = vv.Transparency + 0.12
  1325. vv.Mesh.Scale = vv.Mesh.Scale + Vector3.new(0.3,-0.1,-0.1)
  1326. end
  1327. if v:FindFirstChild("Effect").Transparency > 0.9 then
  1328. v:Destroy()
  1329. table.remove(SnowSplosionEffects,i)
  1330. end
  1331. end
  1332.  
  1333. lastpose = script.pose.Value
  1334. lastanim = anim
  1335. prevvelocity = HRP.Velocity
  1336. end)
  1337. end
  1338.  
  1339. script.Parent.MouseButton1Down:connect(click)
  1340.  
  1341. end
  1342. coroutine.resume(coroutine.create(SCRIPT_NOBB79_FAKESCRIPT))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement