Advertisement
zooperstar23

Untitled

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