Advertisement
NyonicBear

drg

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