Advertisement
KHSora455

Survivor Script

May 9th, 2015
2,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.14 KB | None | 0 0
  1. function clerp(c1,c2,al)
  2. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  3. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  4. for i,v in pairs(com1) do
  5. com1[i] = v+(com2[i]-v)*al
  6. end
  7. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  8. end
  9.  
  10. plr = game:service'Players'.LocalPlayer
  11. char = plr.Character
  12. mouse = plr:GetMouse()
  13. humanoid = char:findFirstChild("Humanoid")
  14. torso = char:findFirstChild("Torso")
  15. head = char.Head
  16. ra = char:findFirstChild("Right Arm")
  17. la = char:findFirstChild("Left Arm")
  18. rl = char:findFirstChild("Right Leg")
  19. ll = char:findFirstChild("Left Leg")
  20. rs = torso:findFirstChild("Right Shoulder")
  21. ls = torso:findFirstChild("Left Shoulder")
  22. rh = torso:findFirstChild("Right Hip")
  23. lh = torso:findFirstChild("Left Hip")
  24. neck = torso:findFirstChild("Neck")
  25. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  26. animate = char:findFirstChild("Animate")
  27. if animate then
  28. animate:Destroy()
  29. end
  30. rootpart = char:findFirstChild("HumanoidRootPart")
  31. camera = workspace.CurrentCamera
  32.  
  33. pcall(function() char:findFirstChild('charmodel'):Destroy() char:findFirstChild('SurvivorScript').Disabled = true char:findFirstChild('SurvivorScript'):Destroy() char:findFirstChild'FakeHead':Destroy()
  34. plr.PlayerGui:findFirstChild'BaseGui':Destroy() end)
  35.  
  36. script.Name = 'SurvivorScript'
  37.  
  38. charmodel = Instance.new("Model", char)
  39. charmodel.Name = "charmodel"
  40.  
  41. local rm = Instance.new("Motor", torso)
  42. rm.C0 = CFrame.new(1.5, 0.5, 0)
  43. rm.C1 = CFrame.new(0, 0.5, 0)
  44. rm.Part0 = torso
  45. rm.Part1 = ra
  46. rm.Name = "Right Shoulder"
  47.  
  48. local lm = Instance.new("Motor", torso)
  49. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  50. lm.C1 = CFrame.new(0, 0.5, 0)
  51. lm.Part0 = torso
  52. lm.Part1 = la
  53. lm.Name = "Left Shoulder"
  54.  
  55. local rlegm = Instance.new("Motor", torso)
  56. rlegm.C0 = CFrame.new(0.5, -1, 0)
  57. rlegm.C1 = CFrame.new(0, 1, 0)
  58. rlegm.Part0 = torso
  59. rlegm.Part1 = rl
  60. rlegm.Name = "Right Hip"
  61.  
  62. local llegm = Instance.new("Motor", torso)
  63. llegm.C0 = CFrame.new(-0.5, -1, 0)
  64. llegm.C1 = CFrame.new(0, 1, 0)
  65. llegm.Part0 = torso
  66. llegm.Part1 = ll
  67. llegm.Name = "Left Hip"
  68.  
  69. neck.C0 = CFrame.new(0, 1, 0)
  70. neck.C1 = CFrame.new(0, -0.5, 0)
  71.  
  72. rj.C0 = CFrame.new(0, -1.5, 0)
  73. rj.C1 = CFrame.new(0, -1.5, 0)
  74.  
  75. function LoadChatColorModule()
  76. local COLOR_TABLE, Get, GetId
  77. COLOR_TABLE = {
  78. BrickColor.new("Really black"),
  79. BrickColor.new("Really black"),
  80. BrickColor.new("Really black"),
  81. BrickColor.new("Really black"),
  82. BrickColor.new("Really black"),
  83. BrickColor.new("Really black"),
  84. BrickColor.new("Really black"),
  85. BrickColor.new("Really black")
  86. }
  87. function Get(name)
  88. return COLOR_TABLE[GetId(name) + 1]
  89. end
  90. function GetId(name)
  91. local length = #name
  92. local modifier = (length % 2 == 0) and 1 or 0
  93. local value = 0
  94. for index = 1, length do
  95. if (length - index + modifier) % 4 < 2 then
  96. value = value + string.byte(name, index)
  97. else
  98. value = value - string.byte(name, index)
  99. end
  100. end
  101. return value % 8
  102. end
  103. return {
  104. COLOR_TABLE = COLOR_TABLE,
  105. Get = Get,
  106. GetId = GetId
  107. }
  108. end
  109.  
  110. local ChatColor = LoadChatColorModule()
  111. local PocketColor = BrickColor.new(ChatColor.Get(plr.Name).Name)
  112.  
  113.  
  114.  
  115. rsc0 = rm.C0
  116. lsc0 = lm.C0
  117. neckc0 = neck.C0
  118. rootc0 = rj.C0
  119. llc0 = llegm.C0
  120. rlc0 = rlegm.C0
  121. speed = 0.25
  122. angle = 0
  123. mvmnt = 0
  124. anglespeed = 1
  125. humanoid.WalkSpeed = 8
  126. ctrl = false
  127. stopsprint = false
  128. action = false
  129. sprinting = false
  130. time_sprinted = 0
  131. sound_play_time = 0
  132.  
  133. local debounce = false
  134. local knife = false
  135. local knifeslash = false
  136.  
  137. mouse.KeyDown:connect(function(k)
  138. repeat wait() until action == false
  139. if not action then
  140. if k:byte() == 48 then
  141. sprinting = true
  142. humanoid.WalkSpeed = 32
  143. end
  144. if k == '2' or k == 'c' then
  145. if not prone then
  146. ctrl = not ctrl
  147. if ctrl then
  148. humanoid.WalkSpeed = 5
  149. else
  150. humanoid.WalkSpeed = 8
  151. end
  152. end
  153. end
  154. if k == "y" then
  155. flashlight = not flashlight
  156. if flashlight then
  157. do
  158. knife = false
  159. if charmodel:findFirstChild("Knife") then
  160. charmodel:findFirstChild("Knife"):Destroy()
  161. end
  162. local part = Instance.new("Part", charmodel)
  163. part.CanCollide = false
  164. part.FormFactor = 'Custom'
  165. part.Name = "Flashlight"
  166. part.Size = Vector3.new(.4, .4, 2.1)
  167. part:breakJoints()
  168. local mesh = Instance.new("SpecialMesh", part)
  169. mesh.TextureId = "rbxassetid://129026436"
  170. mesh.MeshId = "rbxassetid://87653956"
  171. mesh.Scale = Vector3.new(.7, .7, .7)
  172. local weld = Instance.new("Weld", part)
  173. weld.Part0 = part
  174. weld.Part1 = ra
  175. weld.C0 = CFrame.Angles(math.rad(70), 0, -math.rad(10))
  176. weld.C1 = CFrame.new(-.08, -1.225, .05)
  177.  
  178.  
  179. local point = Instance.new("PointLight", part)
  180. point.Range = 20
  181. local spot = Instance.new("SpotLight", part)
  182. spot.Shadows = true
  183. spot.Range = 55
  184. spot.Angle = 60
  185. spot.Brightness = 30
  186. end
  187. else
  188. if charmodel:findFirstChild("Flashlight") then
  189. charmodel:findFirstChild("Flashlight"):Destroy()
  190. end
  191. end
  192. end
  193. if k == "x" then
  194. ctrl = false
  195. prone = true
  196. humanoid.WalkSpeed = 2.5
  197. end
  198. if k == "t" then
  199. knife = not knife
  200. if knife then
  201. flashlight = false
  202. if charmodel:findFirstChild("Flashlight") then
  203. charmodel:findFirstChild("Flashlight"):Destroy()
  204. end
  205. local part = Instance.new("Part", charmodel)
  206. part.CanCollide = false
  207. part.FormFactor = 'Custom'
  208. part.Name = "Knife"
  209. part.Size = Vector3.new(.2, 1.7, .25)
  210. part:breakJoints()
  211. local weld = Instance.new("Weld", part)
  212. weld.Part0 = part
  213. weld.Part1 = ra
  214. weld.C0 = CFrame.Angles(math.pi/2, 0, -math.rad(10))
  215. weld.C1 = CFrame.new(0, -1, -.45)
  216. Instance.new("BlockMesh", part).Scale = Vector3.new(.5, 1, .8)
  217. local part2 = Instance.new("Part", part)
  218. part2.CanCollide = false
  219. part2.FormFactor = 'Custom'
  220. part2.Name = "Knife"
  221. part2.BrickColor = BrickColor.Black()
  222. part2.Size = Vector3.new(.3, 1.2, .3)
  223. part2:breakJoints()
  224. local weld2 = Instance.new("Weld", part2)
  225. weld2.Part0 = part2
  226. weld2.Part1 = part
  227. weld2.C1 = CFrame.new(0, -.45, 0)
  228. Instance.new("BlockMesh", part2).Scale = Vector3.new(.5, 1, .8)
  229. else
  230. if charmodel:findFirstChild("Knife") then
  231. charmodel:findFirstChild("Knife"):Destroy()
  232. end
  233. end
  234. end
  235. end
  236. end)
  237.  
  238. mouse.KeyUp:connect(function(k)
  239. repeat wait() until action == false
  240. if not action then
  241. repeat wait() until action == false
  242. if k:byte() == 48 then
  243. sprinting = false
  244. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 10 and hitz and time_sprinted >= .8 then
  245. time_sprinted = 0
  246. action = 'StopSprinting'
  247. end
  248. humanoid.WalkSpeed = 8
  249. if ctrl then
  250. humanoid.WalkSpeed = 5
  251. end
  252. if prone then
  253. humanoid.WalkSpeed = 2.55
  254. end
  255. end
  256. if k == 'x' then
  257. prone = false
  258. if ctrl then
  259. humanoid.WalkSpeed = 5
  260. else
  261. humanoid.WalkSpeed = 8
  262. end
  263. end
  264. end
  265. end)
  266.  
  267.  
  268. mouse.Button1Down:connect(function()
  269. if knife == true then
  270. if debounce then return end
  271. local slashs = Instance.new("Sound", head)
  272. slashs.SoundId = "rbxasset://sounds/swordslash.mp3"
  273. slashs.Volume = 1
  274. slashs.Pitch = 2
  275. slashs.Name = 'Slash'
  276. slashs:play()
  277. debounce = true
  278. knifeslash = true
  279. wait(.35)
  280. if charmodel:findFirstChild('Knife') then
  281. local killdeb = false
  282. charmodel:findFirstChild('Knife').Touched:connect(function(hit)
  283. if knifeslash then
  284. if killdeb then return end
  285. if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") and hit.Parent.Name ~= char.Name then
  286. killdeb = true
  287. hit.Parent:findFirstChild("Humanoid"):TakeDamage(math.random(45,50))
  288. local hitsound = Instance.new("Sound", head)
  289. hitsound.SoundId = "rbxasset://sounds/metal.mp3"
  290. hitsound.Volume = 1
  291. hitsound.Name = 'Hit'
  292. hitsound:play()
  293. wait(.5)
  294. hitsound:Destroy()
  295. slashs:Destroy()
  296. end
  297. end
  298. end)
  299. end
  300. knifeslash = false
  301. wait(.5)
  302. debounce = false
  303. end
  304. end)
  305.  
  306. plr.Chatted:connect(function(msg)
  307. if msg == "/e dance" then
  308. action = 'Dancing'
  309. end
  310. if msg == "/e point" then
  311. action = 'Pointing'
  312. end
  313. if msg == "/e wave" then
  314. action = 'Waving'
  315. end
  316. if msg == "/e cheer" then
  317. action = 'Cheering'
  318. end
  319. if msg == "/e squat" then
  320. action = 'Squatting'
  321. end
  322. if msg == "/e sit" then
  323. action = 'Sitting'
  324. end
  325. end)
  326.  
  327. Controls = game:service'ControllerService':children()[1]
  328.  
  329. local fakehead = head:clone()
  330. fakehead.Parent = char
  331. fakehead.Name = 'FakeHead'
  332. head.Transparency = 1
  333. for i,v in pairs(fakehead:children()) do
  334. if v:IsA'Sound' or v:IsA'Decal' then
  335. v:Destroy()
  336. end
  337. end
  338.  
  339. for i,v in pairs(head:children()) do
  340. if v:IsA'Sound' then
  341. v:Destroy()
  342. end
  343. end
  344.  
  345. waitingloop = false
  346.  
  347. local fakeweld = Instance.new("Weld", fakehead)
  348. fakeweld.Part0 = head
  349. fakeweld.Part1 = fakehead
  350.  
  351. humanoid.Jumping:connect(function()
  352. if not action or not prone then
  353. action = 'Jumping'
  354. end
  355. end)
  356.  
  357. local ScreenGui = Instance.new("ScreenGui", plr.PlayerGui)
  358. ScreenGui.Name = "BaseGui"
  359. local WhatObject = Instance.new("TextLabel", ScreenGui)
  360. WhatObject.Size = UDim2.new(0, 50, 0, 10)
  361. WhatObject.BackgroundColor3 = Color3.new(.25, .25, .25)
  362. WhatObject.BackgroundTransparency = .45
  363. WhatObject.TextColor3 = Color3.new(1,1,1)
  364. WhatObject.TextXAlignment = 'Left'
  365. WhatObject.Visible = false
  366. local WhatObjectI = Instance.new("TextLabel", ScreenGui)
  367. WhatObjectI.Size = UDim2.new(0, 50, 0, 10)
  368. WhatObjectI.BackgroundColor3 = Color3.new(.05, .05, .05)
  369. WhatObjectI.TextColor3 = Color3.new(1,1,1)
  370. WhatObjectI.FontSize = "Size12"
  371. WhatObjectI.TextYAlignment = 'Top'
  372. WhatObjectI.TextXAlignment = 'Left'
  373. WhatObjectI.Visible = false
  374. WhatObjectI.ZIndex = 3
  375.  
  376. local RadioFrame = Instance.new("Frame", ScreenGui)
  377. RadioFrame.Size = UDim2.new(0, 90, 0, 30)
  378. RadioFrame.Position = UDim2.new(0, 0, .4, 0)
  379. RadioFrame.BackgroundColor3 = Color3.new(.25, .25, .25)
  380.  
  381. local InventoryBut = Instance.new("TextButton", ScreenGui)
  382. InventoryBut.Size = UDim2.new(0, 90, 0, 30)
  383. InventoryBut.Text = 'Inventory'
  384. InventoryBut.TextColor3 = Color3.new(1,1,1)
  385. InventoryBut.TextScaled = true
  386. InventoryBut.Position = UDim2.new(.4, 0, 0, 0)
  387. InventoryBut.BackgroundColor3 = Color3.new(.25, .25, .25)
  388.  
  389. local InventoryGui = Instance.new("Frame", ScreenGui)
  390. InventoryGui.Size = UDim2.new(.6, 0, .6, 0)
  391. InventoryGui.BackgroundColor3 = Color3.new(.25, .25, .25)
  392. InventoryGui.Position = UDim2.new(.2, 0, -1, 0)
  393.  
  394. InventoryBut.TouchTap:connect(function()
  395. InvVisible = not InvVisible
  396. if InvVisible then
  397. InventoryGui:TweenPosition(UDim2.new(.2, 0, .2, 0), "Out", "Quad", .35, true)
  398. elseif not InvVisible then
  399. InventoryGui:TweenPosition(UDim2.new(.2, 0, -1, 0), "Out", "Quad", .35, true)
  400. end
  401. end)
  402. InventoryBut.MouseButton1Down:connect(function()
  403. InvVisible = not InvVisible
  404. if InvVisible then
  405. InventoryGui:TweenPosition(UDim2.new(.2, 0, .2, 0), "Out", "Quad", .35, true)
  406. elseif not InvVisible then
  407. InventoryGui:TweenPosition(UDim2.new(.2, 0, -1, 0), "Out", "Quad", .35, true)
  408. end
  409. end)
  410.  
  411. Buildings = {}
  412.  
  413. local WoodenFence = Instance.new("Part")
  414. WoodenFence.Size = Vector3.new(10, 5, 1)
  415. WoodenFence.Anchored = true
  416. WoodenFence.Material = 'Wood'
  417. WoodenFence.BrickColor = BrickColor.new'Really red'
  418. table.insert(Buildings, {WoodenFence = 'Wooden Fence'})
  419.  
  420. for y = 1, 4 do
  421. for x = 1, 4 do
  422. local slot = Instance.new("ImageLabel", InventoryGui)
  423. slot.Name = "Slot"..tostring(#InventoryGui:children())
  424. slot.Size = UDim2.new(.155, 0, .2, 0)
  425. slot.ZIndex = 2
  426. slot.Position = UDim2.new(.2+((x-1)/4)*.8, 0, .025+(y-1)/4, 0)
  427. slot.BackgroundColor3 = Color3.new(.35, .35, .35)
  428. local stack = Instance.new("TextLabel", slot)
  429. stack.Size = UDim2.new(0, 0, 0, 25)
  430. stack.Position = UDim2.new(.95, 0, 1, -25)
  431. stack.TextXAlignment = 'Right'
  432. stack.FontSize = "Size12"
  433. stack.ZIndex = 3
  434. stack.TextColor3 = Color3.new(1,1,1)
  435. stack.BackgroundTransparency = 1
  436. stack.TextStrokeTransparency = .5
  437. stack.Visible = false
  438. stack.TextScaled = true
  439. Instance.new("StringValue", slot).Name = 'ItemName'
  440. Instance.new("StringValue", slot).Name = 'Description'
  441. Instance.new("NumberValue", slot).Name = 'Stack'
  442. Instance.new("BoolValue", slot).Name = 'Functionable'
  443. Instance.new("StringValue", slot.Functionable).Name = 'Function'
  444. slot.Functionable.Value = false
  445. slot.Functionable.Changed:connect(function()
  446. if slot.Functionable.Function.Value == 'Place' then
  447. slot.MouseButton1Down:connect(function()
  448. InvVisible = false
  449. InventoryGui:TweenPosition(UDim2.new(.2, 0, -1, 0), "Out", "Quad", .35, true)
  450. local PlaceObject
  451. for i,v in pairs(Buildings) do
  452. if v.Name == slot.Name.Value then
  453. PlaceObject = v:clone()
  454. PlabeObject.Parent = workspace
  455. end
  456. end
  457. local Placed = false
  458. mouse.KeyDown:connect(function(k)
  459. if Placed then return end
  460. if k == "r" then
  461. if PlaceObject:IsA'Model' then
  462. PlabeObject.Dragger:AxisRotate()
  463. end
  464. if PlaceObject:IsA'Part' then
  465. PlaceObject.Rotation = Vector3.new(PlabeObject.Rotation.X, PlabeObject.Rotation.Y+90, PlabeObject.Rotation.Z)
  466. end
  467. end
  468. end)
  469. mouse.Move:connect(function()
  470. if Placed then return end
  471. PlaceObject:TranslateBy(Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z))
  472. end)
  473. mouse.Button1Down:connect(function()
  474. Placed = true
  475. end)
  476. end)
  477. end
  478. end)
  479. slot.Stack.Changed:connect(function()
  480. if slot.Stack.Value == '0' then
  481. stack.Visible = false
  482. else
  483. stack.Visible = true
  484. stack.Text = slot.Stack.Value
  485. stack.Size = UDim2.new(0, -stack.TextBounds.x, 0, 25)
  486. end
  487. end)
  488. slot.MouseEnter:connect(function()
  489. if slot.Description.Value ~= '' then
  490. WhatObjectI.Parent = slot
  491. WhatObjectI.Position = UDim2.new(0, 0, 1, 0)
  492. WhatObjectI.Text = slot.Description.Value
  493. wait(0)
  494. WhatObjectI.Size = UDim2.new(0, WhatObjectI.TextBounds.x, 0, WhatObjectI.TextBounds.Y)
  495. WhatObjectI.Visible = true
  496. end
  497. end)
  498. slot.MouseLeave:connect(function()
  499. WhatObjectI.Visible = false
  500. end)
  501. end
  502. end
  503.  
  504. InventoryGui.Slot1.Image = "rbxassetid://154927249"
  505. InventoryGui.Slot1.Description.Value = [[A regular flashlight,
  506. Equip with F.]]
  507.  
  508. InventoryGui.Slot2.Image = "rbxassetid://154931868"
  509. InventoryGui.Slot2.Description.Value = [[It's a survival knife,
  510. slaughter or gather materials!
  511. Equip with K.]]
  512.  
  513. InventoryGui.Slot3.Description.Value = [[It's wood,
  514. You can build or use it as material.]]
  515. InventoryGui.Slot3.Stack.Value = 10
  516. InventoryGui.Slot3.Image = "rbxassetid://154979500"
  517.  
  518. InventoryGui.Slot4.ItemName.Value = "Wooden Fence"
  519. InventoryGui.Slot4.Description.Value = [[Defending building.]]
  520. InventoryGui.Slot4.Stack.Value = 1
  521. InventoryGui.Slot4.Functionable.Function.Value = 'Place'
  522.  
  523. radiosound = Instance.new("Sound", head)
  524. radiosound.Volume = 1
  525. radiosound.Name = 'IMPOSSIBRU'
  526.  
  527. Music = {
  528. ['1'] = function(plr)
  529. game:service'ContentProvider':Preload("rbxassetid://142386276")
  530. radiosound.SoundId = "rbxassetid://142386276"
  531. radiosound.Pitch = 1
  532. end;
  533. ['2'] = function(plr)
  534. game:service'ContentProvider':Preload("rbxassetid://142329020")
  535. radiosound.SoundId = "rbxassetid://142329020"
  536. end;
  537. ['3'] = function(plr)
  538. game:service'ContentProvider':Preload("rbxassetid://145262991")
  539. radiosound.SoundId = "rbxassetid://145262991"
  540. end;
  541. ['4'] = function(plr)
  542. game:service'ContentProvider':Preload("rbxassetid://142603004")
  543. radiosound.SoundId = "rbxassetid://142603004"
  544. end;
  545. ['5'] = function(plr)
  546. game:service'ContentProvider':Preload("rbxassetid://143146783")
  547. radiosound.SoundId = "rbxassetid://143146783"
  548. end;
  549. ['6'] = function(plr)
  550. game:service'ContentProvider':Preload("rbxassetid://27697392")
  551. radiosound.SoundId = "rbxassetid://27697392"
  552. end;
  553. ['7'] = function(plr)
  554. game:service'ContentProvider':Preload("rbxassetid://142281425")
  555. radiosound.SoundId = "rbxassetid://142281425"
  556. end;
  557. ['8'] = function(plr)
  558. game:service'ContentProvider':Preload("rbxassetid://143654440")
  559. radiosound.SoundId = "rbxassetid://143654440"
  560. end;
  561. ['9'] = function(plr)
  562. game:service'ContentProvider':Preload("rbxassetid://142332086")
  563. radiosound.SoundId = "rbxassetid://142332086"
  564. end;
  565. ['10'] = function(plr)
  566. game:service'ContentProvider':Preload("rbxassetid://142373420")
  567. radiosound.SoundId = "rbxassetid://142373420"
  568. radiosound.Pitch = .525
  569. end;
  570. ['11'] = function(plr)
  571. game:service'ContentProvider':Preload("rbxassetid://144003603")
  572. radiosound.SoundId = "rbxassetid://144003603"
  573. radiosound.Pitch = 1
  574. end;
  575. ['12'] = function(plr)
  576. game:service'ContentProvider':Preload("rbxassetid://149672967")
  577. radiosound.SoundId = "rbxassetid://149672967"
  578. end;
  579. ['13'] = function(plr)
  580. game:service'ContentProvider':Preload("rbxassetid://153574819")
  581. radiosound.SoundId = "rbxassetid://153574819"
  582. end;
  583. ['14'] = function(plr)
  584. game:service'ContentProvider':Preload("rbxassetid://152497436")
  585. radiosound.SoundId = "rbxassetid://152497436"
  586. end;
  587. ['15'] = function(plr)
  588. game:service'ContentProvider':Preload("rbxassetid://145183026")
  589. radiosound.SoundId = "rbxassetid://145183026"
  590. end;
  591. ['16'] = function(plr)
  592. game:service'ContentProvider':Preload("rbxassetid://149069781")
  593. radiosound.SoundId = "rbxassetid://149069781"
  594. end;
  595. ['17'] = function(plr)
  596. game:service'ContentProvider':Preload("rbxassetid://142290799")
  597. radiosound.SoundId = "rbxassetid://142290799"
  598. end;
  599. ['18'] = function(plr)
  600. game:service'ContentProvider':Preload("rbxassetid://142386784")
  601. radiosound.SoundId = "rbxassetid://142386784"
  602. end;
  603. ['19'] = function(plr)
  604. game:service'ContentProvider':Preload("rbxassetid://144364636")
  605. radiosound.SoundId = "rbxassetid://144364636"
  606. end;
  607. ['20'] = function(plr)
  608. game:service'ContentProvider':Preload("rbxassetid://153901645")
  609. radiosound.SoundId = "rbxassetid://153901645"
  610. end;
  611. ['21'] = function(plr)
  612. game:service'ContentProvider':Preload("rbxassetid://146208956")
  613. radiosound.SoundId = "rbxassetid://146208956"
  614. end;
  615. ['22'] = function(plr)
  616. game:service'ContentProvider':Preload("rbxassetid://147632089")
  617. radiosound.SoundId = "rbxassetid://147632089"
  618. end;
  619. ['23'] = function(plr)
  620. game:service'ContentProvider':Preload("rbxassetid://147632111")
  621. radiosound.SoundId = "rbxassetid://147632111"
  622. end;
  623. ['24'] = function(plr)
  624. game:service'ContentProvider':Preload("rbxassetid://149613358")
  625. radiosound.SoundId = "rbxassetid://149613358"
  626. end;
  627. ['25'] = function(plr)
  628. game:service'ContentProvider':Preload("rbxassetid://148424799")
  629. radiosound.SoundId = "rbxassetid://148424799"
  630. end;
  631. ['26'] = function(plr)
  632. game:service'ContentProvider':Preload("rbxassetid://145559291")
  633. radiosound.SoundId = "rbxassetid://145559291"
  634. end;
  635. ['27'] = function(plr)
  636. game:service'ContentProvider':Preload("rbxassetid://152701334")
  637. radiosound.SoundId = "rbxassetid://152701334"
  638. end;
  639. ['28'] = function(plr)
  640. game:service'ContentProvider':Preload("rbxassetid://149410799")
  641. radiosound.SoundId = "rbxassetid://149410799"
  642. end;
  643. ['29'] = function(plr)
  644. game:service'ContentProvider':Preload("rbxassetid://143760499")
  645. radiosound.SoundId = "rbxassetid://143760499"
  646. end;
  647. ['30'] = function(plr)
  648. game:service'ContentProvider':Preload("rbxassetid://145045424")
  649. radiosound.SoundId = "rbxassetid://145045424"
  650. end;
  651. ['31'] = function(plr)
  652. game:service'ContentProvider':Preload("rbxassetid://142402325")
  653. radiosound.SoundId = "rbxassetid://142402325"
  654. radiosound.Pitch = 0.575
  655. end;
  656. ['32'] = function(plr)
  657. game:service'ContentProvider':Preload("rbxassetid://142858688")
  658. radiosound.SoundId = "rbxassetid://142858688"
  659. radiosound.Pitch = 1
  660. end;
  661. ['33'] = function(plr)
  662. game:service'ContentProvider':Preload("rbxassetid://142339237")
  663. radiosound.SoundId = "rbxassetid://142339237"
  664. end;
  665. ['34'] = function(plr)
  666. game:service'ContentProvider':Preload("rbxassetid://142339342")
  667. radiosound.SoundId = "rbxassetid://142339342"
  668. end;
  669. ['35'] = function(plr)
  670. game:service'ContentProvider':Preload("rbxassetid://145518162")
  671. radiosound.SoundId = "rbxassetid://145518162"
  672. end;
  673. ['36'] = function(plr)
  674. game:service'ContentProvider':Preload("rbxassetid://142677206")
  675. radiosound.SoundId = "rbxassetid://142677206"
  676. end;
  677. }
  678.  
  679. local HowMuchMusic = 0
  680. for _,_ in pairs(Music) do
  681. HowMuchMusic = HowMuchMusic + 1
  682. end
  683. RadioEnabled = false
  684. local song
  685. local current = 1
  686. local CurrentNumber = Instance.new("TextLabel", RadioFrame)
  687. CurrentNumber.Size = UDim2.new(0, 60, 0, 15)
  688. CurrentNumber.Position = UDim2.new(0, 0, 0, -15)
  689. CurrentNumber.TextColor3 = Color3.new(1,1,1)
  690. CurrentNumber.BackgroundTransparency = 1
  691. CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
  692. CurrentNumber.TextScaled = true
  693. local OnOff = Instance.new("TextButton", RadioFrame)
  694. OnOff.Size = UDim2.new(0, 60, 0, 28)
  695. OnOff.Position = UDim2.new(0, 1, 0, 1)
  696. OnOff.TextColor3 = Color3.new(1,1,1)
  697. OnOff.BackgroundColor3 = Color3.new(.6, 0, 0)
  698. OnOff.Text = 'OFF'
  699. OnOff.TextScaled = true
  700.  
  701. function nextSong(current2)
  702. local CurrentSong = current2
  703. coroutine.wrap(function()
  704. for i = 1, 121 do
  705. if RadioEnabled and CurrentSong == current2 then
  706. wait(1)
  707. else return end
  708. end
  709. if RadioEnabled and CurrentSong == current then
  710. radiosound:stop()
  711. current = current + 1
  712. if current > HowMuchMusic then
  713. current = 1
  714. end
  715. for index,func in pairs(Music) do
  716. if index == tostring(current) then
  717. func(plr)
  718. end
  719. end
  720. CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
  721. radiosound:play()
  722. nextSong(current)
  723. end
  724. end)()
  725. end
  726.  
  727. OnOff.MouseButton1Down:connect(function()
  728. RadioEnabled = not RadioEnabled
  729. if RadioEnabled then
  730. OnOff.BackgroundColor3 = Color3.new(0, .6, 0)
  731. OnOff.Text = 'ON'
  732. song = Music[tostring(current)]
  733. for index,func in pairs(Music) do
  734. if index == tostring(current) then
  735. func(plr)
  736. end
  737. end
  738. radiosound:play()
  739. nextSong(current)
  740. elseif not RadioEnabled then
  741. OnOff.BackgroundColor3 = Color3.new(.6, 0, 0)
  742. OnOff.Text = 'OFF'
  743. radiosound:pause()
  744. end
  745. end)
  746.  
  747. OnOff.TouchTap:connect(function()
  748. RadioEnabled = not RadioEnabled
  749. if RadioEnabled then
  750. OnOff.BackgroundColor3 = Color3.new(0, .6, 0)
  751. OnOff.Text = 'ON'
  752. song = Music[tostring(current)]
  753. for index,func in pairs(Music) do
  754. if index == tostring(current) then
  755. func(plr)
  756. end
  757. end
  758. radiosound:play()
  759. CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
  760. radiosound:play()
  761. nextSong(current)
  762. elseif not RadioEnabled then
  763. OnOff.BackgroundColor3 = Color3.new(.6, 0, 0)
  764. OnOff.Text = 'OFF'
  765. radiosound:pause()
  766. end
  767. end)
  768.  
  769. local Next = Instance.new("TextButton", RadioFrame)
  770. Next.Size = UDim2.new(0, 28, 0, 28)
  771. Next.Position = UDim2.new(0, 61, 0, 1)
  772. Next.TextColor3 = Color3.new(1,1,1)
  773. Next.BackgroundTransparency = 1
  774. Next.Text = '>'
  775.  
  776. Next.MouseButton1Down:connect(function()
  777. radiosound:stop()
  778. radiosound:stop()
  779. current = current + 1
  780. if current > HowMuchMusic then
  781. current = 1
  782. end
  783. CurrentNumber.Text = tostring(current).."/"..HowMuchMusic
  784. song = Music[tostring(current)]
  785. for index,func in pairs(Music) do
  786. if index == tostring(current) then
  787. func(plr)
  788. end
  789. end
  790. if RadioEnabled then
  791. radiosound:play()
  792. end
  793. end)
  794.  
  795. humanoid.Changed:connect(function(changed)
  796. --[[if ctrl and changed == 'Jump' then
  797. humanoid.Jump = false
  798. action = 'Rolling'
  799. end--]]
  800. if action ~= false or prone then
  801. humanoid.Jump = false
  802. end
  803. end)
  804.  
  805. humanoid.Climbing:connect(function(speed)
  806. if speed > 4 then
  807. action = 'Climbing'
  808. humanoid.WalkSpeed = 8
  809. else
  810. action = false
  811. if ctrl then
  812. humanoid.WalkSpeed = 5
  813. elseif prone then
  814. humanoid.WalkSpeed = 2.5
  815. end
  816. end
  817. end)
  818.  
  819. mouse.Move:connect(function()
  820. if (mouse.Target ~= nil and mouse.Target:IsA('Part') and mouse.Target.Parent and mouse.Target.Parent:IsA('Model') and mouse.Target.Parent:findFirstChild'Humanoid') or (mouse.Target ~= nil and mouse.Target:IsA('Part') and mouse.Target.Parent and mouse.Target.Parent:IsA'Hat' and mouse.Target.Parent.Parent and mouse.Target.Parent.Parent:findFirstChild'Humanoid') then
  821. local target = mouse.Target
  822. WhatObject.Visible = true
  823. if target.Parent:IsA'Model' then
  824. WhatObject.Text = target.Parent.Name
  825. elseif target.Parent:IsA'Hat' then
  826. WhatObject.Text = target.Parent.Parent.Name
  827. end
  828. WhatObject.Size = UDim2.new(0, WhatObject.TextBounds.x, 0, 10)
  829. WhatObject.Position = UDim2.new(0, mouse.X + 10, 0, mouse.Y - 15)
  830. else
  831. WhatObject.Visible = false
  832. end
  833. end)
  834.  
  835. wait()
  836.  
  837. local sound = Instance.new("Sound", head)
  838. sound.Volume = .65
  839. game:service'RunService'.Stepped:connect(function()
  840. if prone or ctrl then
  841. rootpart.CanCollide = false
  842. end
  843. end)
  844.  
  845. idling = 0
  846. dancingtime = 0
  847.  
  848. game:service'RunService'.RenderStepped:connect(function()
  849. if charmodel.Parent ~= char then charmodel.Parent = char end
  850. if fakehead.Parent ~= char then fakehead.Parent = char end
  851. if not loopedaction then
  852. local rscf = rsc0
  853. local lscf = lsc0
  854. local rlcf = rlc0
  855. local llcf = llc0
  856. local rjcf = rootc0
  857. local ncf = neckc0
  858. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
  859. local hitz, enz = workspace:findPartOnRay(rayz, char)
  860. angle = (angle % 100) + anglespeed/10
  861. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  862. for i,object in pairs(char:children()) do
  863. if object:IsA("Tool") then
  864. if not wldunknown then
  865. wldunknown = Instance.new("Weld", rarm)
  866. wldunknown.Name = "RightGrip"
  867. wldunknown.Part0 = rarm
  868. if object:findFirstChild("Handle") then
  869. wldunknown.Part1 = object:findFirstChild("Handle")
  870. end
  871. end
  872. tool = true
  873. elseif not object:IsA("Tool") then
  874. if tool then
  875. pcall(function()
  876. wldunknown:Destroy()
  877. wldunknown:Destroy()
  878. end)
  879. end
  880. tool = false
  881. end
  882. end
  883. if action ~= false then
  884. idling = 0
  885. if action == 'StopSprinting' then
  886. Controls.Parent = nil
  887. speed = 0.15
  888. local bodyvelocity = Instance.new("BodyVelocity", rootpart)
  889. bodyvelocity.maxForce = Vector3.new(1/0,0,1/0)
  890. bodyvelocity.velocity = rootpart.CFrame.lookVector * 16
  891. ncf = neckc0 * CFrame.Angles(math.rad(-12), -math.rad(15), 0)
  892. rscf = rsc0 * CFrame.Angles(math.rad(-21), 0, math.rad(4.5))
  893. lscf = lsc0 * CFrame.Angles(math.rad(-23.5), 0, -math.rad(3.5))
  894. rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(math.rad(15), math.rad(25), 0)
  895. llcf = llc0 * CFrame.new(0, .15, -.25) * CFrame.Angles(-math.rad(30), 0, -math.rad(5.5))
  896. rlcf = rlcf * CFrame.new(0, .05, -.15) * CFrame.Angles(math.rad(20), 0, math.rad(2))
  897. loopedaction = true
  898. for i = 0, 25 do
  899. bodyvelocity.velocity = rootpart.CFrame.lookVector * (16 - i/1.5)
  900. rm.C0 = clerp(rm.C0,rscf,speed)
  901. lm.C0 = clerp(lm.C0,lscf,speed)
  902. rj.C0 = clerp(rj.C0,rjcf,speed)
  903. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  904. llegm.C0 = clerp(llegm.C0,llcf,speed)
  905. neck.C0 = clerp(neck.C0,ncf,speed)
  906. wait()
  907. end
  908. bodyvelocity:Destroy()
  909. loopedaction = false
  910. stopsprint = false
  911. action = false
  912. Controls.Parent = game:service'ControllerService'
  913. humanoid.WalkSpeed = 8
  914. if ctrl then
  915. humanoid.WalkSpeed = 5
  916. elseif prone then
  917. humanoid.WalkSpeed = 2.5
  918. end
  919. end
  920. if action == "Climbing" then
  921. anglespeed = 2
  922. speed = 0.1
  923. ncf = neckc0 * CFrame.Angles(math.pi/3, 0, 0)
  924. rjcf = rootc0
  925. rscf = rsc0 * CFrame.new(0, -0.2 + -mvmnt*0.2, 0.45) * CFrame.Angles(math.pi/1.5, 0, -math.abs(mvmnt)*0.025)
  926. lscf = lsc0 * CFrame.new(0, -0.2 + mvmnt*0.2, 0.45) * CFrame.Angles(math.pi/1.5, 0, math.abs(mvmnt)*0.025)
  927. rlcf = rlc0 * CFrame.new(0, 0.3 + mvmnt*0.2, 0) * CFrame.Angles(math.pi/14, 0, 0)
  928. llcf = llc0 * CFrame.new(0, 0.3 + -mvmnt*0.2, 0) * CFrame.Angles(math.pi/14, 0, 0)
  929. end
  930. if action == 'Jumping' then
  931. if not prone or ctrl then
  932. loopedaction = true
  933. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  934. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
  935. rscf = rsc0 * CFrame.Angles(-math.pi/16, -math.sin(angle)*0.08, 0)
  936. lscf = lsc0 * CFrame.Angles(-math.pi/17, math.sin(angle)*0.08, 0)
  937. rlcf = rlc0 * CFrame.new(0, .45, -.45) * CFrame.Angles(-math.pi/16+-math.sin(angle)*0.125, -math.sin(angle)*0.08, math.rad(2.5))
  938. llcf = llc0 * CFrame.Angles(-math.pi/17+-math.sin(angle)*0.125, math.sin(angle)*0.08, -math.rad(2.5))
  939. for i = 0, 12 do
  940. rm.C0 = clerp(rm.C0,rscf,speed)
  941. lm.C0 = clerp(lm.C0,lscf,speed)
  942. rj.C0 = clerp(rj.C0,rjcf,speed)
  943. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  944. llegm.C0 = clerp(llegm.C0,llcf,speed)
  945. neck.C0 = clerp(neck.C0,ncf,speed)
  946. wait()
  947. end
  948. end
  949. loopedaction = false
  950. action = false
  951. end
  952. if action == 'Pointing' then
  953. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  954. anglespeed = .5
  955. speed = 0.25
  956. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.007, 0, 0)
  957. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.0015, 0, 0)
  958. rscf = rsc0 * CFrame.Angles(math.pi/2, -math.sin(angle)*0.008, 0)
  959. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.008, 0)
  960. rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.0015, -math.sin(angle)*0.008, math.rad(2.5))
  961. llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.0015, math.sin(angle)*0.008, -math.rad(2.5))
  962. else
  963. action = false
  964. end
  965. end
  966. if action == 'Waving' then
  967. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  968. anglespeed = .5
  969. speed = 0.25
  970. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.007, 0, 0)
  971. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.0025, 0, 0)
  972. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.008, math.pi/1.4+math.sin(angle)*.5)
  973. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.008, 0)
  974. rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.0025, -math.sin(angle)*0.008, math.rad(2.5))
  975. llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.0025, math.sin(angle)*0.008, -math.rad(2.5))
  976. else
  977. action = false
  978. end
  979. end
  980. if action == 'Cheering' then
  981. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  982. anglespeed = 2
  983. speed = 0.25
  984. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  985. rjcf = rootc0 * CFrame.new(0, math.abs(math.sin(angle)), 0)
  986. rscf = rsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.25, 0, math.rad(2))
  987. lscf = lsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.25, 0, -math.rad(2))
  988. rlcf = rlc0 * CFrame.Angles(0, 0, math.rad(5))
  989. llcf = llc0 * CFrame.Angles(0, 0, -math.rad(5))
  990. else
  991. action = false
  992. end
  993. end
  994. if action == 'Rolling' then
  995. loopedaction = true
  996. anglespeed = 2
  997. speed = 0.6
  998. Controls.Parent = nil
  999. local bodyvelocity = Instance.new("BodyVelocity", rootpart)
  1000. bodyvelocity.maxForce = Vector3.new(1/0,1/0,1/0)
  1001. bodyvelocity.velocity = rootpart.CFrame.lookVector * 10
  1002. rj.C1 = CFrame.new()
  1003. for roll = 0, 360, 2 do
  1004. ncf = neckc0 * CFrame.Angles(-math.pi/1.85, 0, 0)
  1005. rjcf = CFrame.new() * CFrame.new(0, -1, 0) * CFrame.Angles(-math.rad(roll), 0, 0)
  1006. rscf = rsc0 * CFrame.Angles(math.pi/2.5, 0, -math.rad(30))
  1007. lscf = lsc0 * CFrame.Angles(math.pi/2.5, 0, math.rad(30))
  1008. rlcf = rlc0 * CFrame.new(0, .6, -.75) * CFrame.Angles(-math.pi/2.5, 0, 0)
  1009. llcf = llc0 * CFrame.new(0, .6, -.75) * CFrame.Angles(-math.pi/2.5, 0, 0)
  1010. rm.C0 = clerp(rm.C0,rscf,speed)
  1011. lm.C0 = clerp(lm.C0,lscf,speed)
  1012. rj.C0 = clerp(rj.C0,rjcf,speed)
  1013. neck.C0 = clerp(neck.C0,ncf,speed)
  1014. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  1015. llegm.C0 = clerp(llegm.C0,llcf,speed)
  1016. wait()
  1017. end
  1018. rj.C0 = CFrame.new(0, -1.5, 0)
  1019. rj.C1 = CFrame.new(0, -1.5, 0)
  1020. bodyvelocity:Destroy()
  1021. action = false
  1022. Controls.Parent = game:service'ControllerService'
  1023. loopedaction = false
  1024. end
  1025. if action == 'Dancing' then
  1026. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  1027. dancingtime = dancingtime + 1/60
  1028. anglespeed = 1
  1029. speed = 0.25
  1030. if dancingtime <= 12 then
  1031. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  1032. rjcf = rootc0 * CFrame.new(0, 0.75 + -math.abs(math.sin(angle)), 0) * CFrame.Angles(0, 0, math.sin(angle)*.1)
  1033. rscf = rsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, math.rad(2))
  1034. lscf = lsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
  1035. rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.25, 0, math.rad(5))
  1036. llcf = llc0 * CFrame.Angles(-math.sin(angle)*.25, 0, -math.rad(5))
  1037. elseif dancingtime <= 22 then
  1038. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  1039. rjcf = rootc0 * CFrame.new(0, math.abs(math.cos(angle)*.05), 0) * CFrame.Angles(0, math.sin(angle)*.035, math.sin(angle)*.015)
  1040. rscf = rsc0 * CFrame.Angles(math.pi/2-math.abs(math.sin(angle))*.5, 0, math.rad(2))
  1041. lscf = lsc0 * CFrame.Angles(math.pi/2-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
  1042. rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.05, 0, math.rad(5))
  1043. llcf = llc0 * CFrame.Angles(-math.sin(angle)*.05, 0, -math.rad(5))
  1044. elseif dancingtime >= 22 then
  1045. dancingtime = 0
  1046. end
  1047. else
  1048. action = false
  1049. end
  1050. end
  1051. if action == 'Squatting' then
  1052. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  1053. anglespeed = 0.15
  1054. speed = 0.25
  1055. ncf = neckc0 * CFrame.Angles(math.pi/12-math.sin(angle)*0.005,0,0)
  1056. rscf = rsc0 * CFrame.new(-.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(-angle)*.005, 0, -math.pi/4.5)
  1057. lscf = lsc0 * CFrame.new(.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(angle)*.005, 0, math.pi/4.5)
  1058. rjcf = rootc0 * CFrame.new(0, -.9, .55) * CFrame.Angles(-math.pi/12+math.sin(angle)*0.005, 0, 0)
  1059. llcf = llc0 * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/12, 0, -math.rad(2))
  1060. rlcf = rlcf * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/14, 0, math.rad(2))
  1061. else
  1062. action = false
  1063. end
  1064. end
  1065. if action == 'Sitting' then
  1066. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  1067. anglespeed = 0.15
  1068. speed = 0.15
  1069. ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.005,0,0)
  1070. rscf = rsc0 * CFrame.Angles(-math.pi/16, 0, math.pi/24)
  1071. lscf = lsc0 * CFrame.Angles(-math.pi/16, 0, -math.pi/24)
  1072. rjcf = rootc0 * CFrame.new(0, -1.9, 0) * CFrame.Angles(math.pi/16+math.sin(angle)*0.005, 0, 0)
  1073. llcf = llc0 * CFrame.new(0, .95, -.75) * CFrame.Angles(math.pi/5, 0, -math.rad(7))
  1074. rlcf = rlcf * CFrame.new(0, .95, -.75) * CFrame.Angles(math.pi/5, 0, math.rad(7))
  1075. else
  1076. action = false
  1077. end
  1078. end
  1079. end
  1080. if hitz and hitz.Material == Enum.Material.Grass or hitz and hitz.Material == Enum.Material.Fabric or hitz and hitz.Material == Enum.Material.Pebble or hitz and hitz.Material == Enum.Material.Sand then
  1081. sound.SoundId = "rbxasset://sounds/grass2.mp3"
  1082. elseif hitz and hitz.Material == Enum.Material.Plastic or hitz and hitz.Material == Enum.Material.SmoothPlastic then
  1083. sound.SoundId = "rbxasset://sounds/plasticplastic.mp3"
  1084. elseif hitz and hitz.Material == Enum.Material.Brick or hitz and hitz.Material == Enum.Material.Slate or hitz and hitz.Material == Enum.Material.Granite or hitz and hitz.Material == Enum.Material.Concrete or hitz and hitz.Material == Enum.Material.Marble then
  1085. sound.SoundId = "rbxasset://sounds/stone.mp3"
  1086. elseif hitz and hitz.Material == Enum.Material.Ice then
  1087. sound.SoundId = "rbxasset://sounds/ice2.mp3"
  1088. elseif hitz and hitz.Material == Enum.Material.CorrodedMetal or hitz and hitz.Material == Enum.Material.DiamondPlate then
  1089. sound.SoundId = "rbxasset://sounds/metal3.mp3"
  1090. elseif hitz and hitz.Material == Enum.Material.Wood then
  1091. sound.SoundId = "rbxasset://sounds/woodwood.mp3"
  1092. end
  1093. if not action then
  1094. if humanoid.Sit then
  1095. ncf = neckc0 * CFrame.Angles(0, 0, 0)
  1096. rjcf = rootc0 * CFrame.new(0, -.5, 0) * CFrame.Angles(math.rad(10), 0, 0)
  1097. rscf = rsc0 * CFrame.Angles(-math.rad(10), 0, math.rad(5))
  1098. lscf = lsc0 * CFrame.Angles(-math.rad(10), 0, -math.rad(5))
  1099. rlcf = rlc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2-math.rad(10), 0, math.rad(5.5))
  1100. llcf = llc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.pi/2-math.rad(10), 0, -math.rad(5.5))
  1101. elseif not hitz and torso.Velocity.y <= -0.5 then
  1102. anglespeed = 1
  1103. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 15 then
  1104. if not waitingloop then
  1105. waitingloop = true
  1106. coroutine.wrap(function()
  1107. repeat wait() until hitz
  1108. action = 'StopSprinting'
  1109. end)()
  1110. end
  1111. end
  1112. anglespeed = 3
  1113. local VelY = torso.Velocity.Y
  1114. if VelY <= -85 then VelY = -85 end
  1115. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  1116. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
  1117. rscf = rsc0 * CFrame.Angles(-math.rad(VelY)-math.sin(angle)*0.48, 0, math.rad(15.5+math.random(-1,3)))
  1118. lscf = lsc0 * CFrame.Angles(-math.rad(VelY)+math.sin(angle)*0.48, 0, -math.rad(15.5+math.random(1,3)))
  1119. rlcf = rlc0 * CFrame.Angles(-math.pi/16+-math.sin(angle)*0.35, -math.sin(angle)*0.008, math.rad(2.5))
  1120. llcf = llc0 * CFrame.Angles(-math.pi/17+math.sin(angle)*0.35, math.sin(angle)*0.008, math.rad(-2.5))
  1121. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  1122. sound_play_time = 0
  1123. if stopsprint and time_sprinted >= .8 then
  1124. time_sprinted = 0
  1125. action = 'StopSprinting'
  1126. end
  1127. time_sprinted = 0
  1128. anglespeed = 0.15
  1129. if prone then
  1130. speed = 0.1
  1131. ncf = neckc0 * CFrame.Angles(math.pi/2.1, 0, 0)
  1132. rscf = rsc0 * CFrame.Angles(math.pi/.2-math.rad(10), -math.sin(angle)*0.02, 0)
  1133. lscf = lsc0 * CFrame.Angles(math.pi/.2-math.rad(10), math.sin(angle)*0.02, 0)
  1134. rjcf = rootc0 * CFrame.new(0, -.95, 0) * CFrame.Angles(-math.pi/2, 0, 0)
  1135. llcf = llc0 * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(-5))
  1136. rlcf = rlcf * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(5))
  1137. elseif ctrl then
  1138. speed = 0.15
  1139. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  1140. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, math.pi/18)
  1141. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, -math.pi/18)
  1142. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  1143. llcf = llc0 * CFrame.new(0, 0, -.4999) * CFrame.Angles(-math.pi/2.2, 0, 0)
  1144. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  1145. elseif not ctrl and not prone then
  1146. speed = 0.15
  1147. idling = idling + 1/60
  1148. if idling >= 60 then
  1149. ncf = neckc0 * CFrame.Angles(math.pi/12-math.sin(angle)*0.005,0,0)
  1150. rscf = rsc0 * CFrame.new(-.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(-angle)*.005, 0, -math.pi/4.5)
  1151. lscf = lsc0 * CFrame.new(.35, 0, -.35+math.sin(angle)*0.005) * CFrame.Angles(math.pi/2.2+math.sin(angle)*.005, 0, math.pi/4.5)
  1152. rjcf = rootc0 * CFrame.new(0, -.9, .55) * CFrame.Angles(-math.pi/12+math.sin(angle)*0.005, 0, 0)
  1153. llcf = llc0 * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/12, 0, -math.rad(2))
  1154. rlcf = rlcf * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/14, 0, math.rad(2))
  1155. else
  1156. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  1157. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
  1158. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, 0)
  1159. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, 0)
  1160. rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.025, -math.sin(angle)*0.08, math.rad(2.5))
  1161. llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.025, math.sin(angle)*0.08, -math.rad(2.5))
  1162. end
  1163. end
  1164. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 10 then
  1165. if stopsprint and time_sprinted >= .8 then
  1166. action = 'StopSprinting'
  1167. end
  1168. sound_play_time = sound_play_time + 1/60
  1169. time_sprinted = 0
  1170. idling = 0
  1171. anglespeed = 1.5
  1172. if prone then
  1173. speed = 0.1
  1174. anglespeed = .85
  1175. ncf = neckc0 * CFrame.Angles(math.pi/2.1, 0, 0)
  1176. rscf = rsc0 * CFrame.new(0, .7+ math.sin(angle)*.35, .1 + math.cos(-angle)*.1) * CFrame.Angles(math.pi/.2-math.rad(10), -math.sin(angle)*0.02, -math.pi/8)
  1177. lscf = lsc0 * CFrame.new(0, .7+ -math.sin(angle)*.35, .1 - math.cos(angle)*.1) * CFrame.Angles(math.pi/.2-math.rad(10), math.sin(angle)*0.02, math.pi/8)
  1178. rjcf = rootc0 * CFrame.new(0, -.95, 0) * CFrame.Angles(-math.pi/2, 0, 0)
  1179. llcf = llc0 * CFrame.new(0, .35 + -math.sin(angle)*.35, 0) * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(-5))
  1180. rlcf = rlcf * CFrame.new(0, .35 + math.sin(angle)*.35, 0) * CFrame.new(0, 0, -.15) * CFrame.Angles(0, 0, math.rad(5))
  1181. elseif ctrl then
  1182. speed = 0.25
  1183. if sound_play_time >= .4 then
  1184. sound.Volume = .45
  1185. sound:play()
  1186. sound_play_time = 0
  1187. end
  1188. ncf = neckc0 * CFrame.Angles(math.pi/12,0,0)
  1189. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.025) * CFrame.Angles(math.pi/24+math.sin(-angle)*.05, 0, math.pi/18-math.abs(mvmnt)*0.02)
  1190. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.025) * CFrame.Angles(math.pi/24+math.sin(angle)*.05, 0, -math.pi/18+math.abs(mvmnt)*0.02)
  1191. rjcf = rootc0 * CFrame.new(0, -.7, 0) * CFrame.Angles(math.abs(math.sin(angle))*0.025 + -math.pi/12, 0, 0)
  1192. llcf = llc0 * CFrame.new(0, .85 + .2 - math.cos(angle)*.2, -.5 + (-.4+math.sin(angle)*0.25)) * CFrame.Angles(math.pi/18 + -math.pi/10 - math.sin(angle)*.45, 0, 0)
  1193. rlcf = rlcf * CFrame.new(0, .85 + .2 + math.cos(angle)*.2, -.5 + (-.25-math.sin(angle)*0.25)) * CFrame.Angles(math.pi/18 + -math.pi/10 + math.sin(angle)*.45, 0, 0)
  1194. elseif not ctrl and not prone then
  1195. speed = 0.25
  1196. if sound_play_time >= .4 then
  1197. sound.Volume = .65
  1198. sound:play()
  1199. sound_play_time = 0
  1200. end
  1201. rjcf = rootc0 * CFrame.Angles(math.abs(math.sin(angle))*0.025 + -math.pi/64, 0, 0)
  1202. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*.5, 0, -math.abs(mvmnt)*0.02)
  1203. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*.5, 0, math.abs(mvmnt)*0.02)
  1204. rlcf = rlc0 * CFrame.new(0, .075 + -math.cos(-angle)*.075, -.05+math.sin(angle)*0.1) * CFrame.Angles(math.sin(-angle)*.45, 0, math.rad(.5))
  1205. llcf = llc0 * CFrame.new(0, .075 - -math.cos(angle)*.075, -.05-math.sin(angle)*0.1) * CFrame.Angles(math.sin(angle)*.45, 0, -math.rad(.5))
  1206. end
  1207. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 15 then
  1208. idling = 0
  1209. time_sprinted = time_sprinted + 1/60
  1210. sound_play_time = sound_play_time + 1/60
  1211. stopsprint = true --when released
  1212. anglespeed = 2
  1213. speed = .3
  1214. if sound_play_time >= .375 then
  1215. sound.Volume = .75
  1216. sound:play()
  1217. sound_play_time = 0
  1218. end
  1219. local RotVelocityZ = torso.RotVelocity.Y
  1220. if RotVelocityZ >= 15 then
  1221. RotVelocityZ = 15
  1222. elseif RotVelocityZ <= -15 then
  1223. RotVelocityZ = -15
  1224. end
  1225. ncf = neckc0 * CFrame.Angles(0, -math.sin(angle)*.1, 0)
  1226. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*1.1, 0, -math.abs(mvmnt)*0.02)
  1227. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*1.1, 0, math.abs(mvmnt)*0.02)
  1228. rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(math.abs(math.sin(angle))*0.055 + -math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045 + math.rad(RotVelocityZ)*2.5)
  1229. rlcf = rlc0 * CFrame.new(0, .3 + -math.cos(-angle)*.3, -.2+math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
  1230. llcf = llc0 * CFrame.new(0, .3 - -math.cos(angle)*.3, -.05-math.sin(angle)*0.25) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
  1231. --rlcf -.2+math.sin(angle)*0.25
  1232. --llcf -.05-math.sin(angle)*0.25
  1233. end
  1234. end
  1235. if knife then
  1236. if prone then
  1237. rscf = rsc0 * CFrame.Angles(math.rad(170), -math.rad(10), -.2)
  1238. else
  1239. rscf = rsc0 * CFrame.Angles(math.rad(50), -math.rad(10), -.2)
  1240. end
  1241. elseif flashlight then
  1242. if prone then
  1243. rscf = rsc0 * CFrame.Angles(math.rad(170), -math.rad(10), -.2)
  1244. else
  1245. rscf = rsc0 * CFrame.Angles(math.rad(70), -math.rad(10), -.2)
  1246. end
  1247. end
  1248. if knifeslash then
  1249. if prone then
  1250. rscf = rsc0 * CFrame.Angles(math.rad(190), -math.rad(10), -.2)
  1251. else
  1252. rscf = rsc0 * CFrame.Angles(math.rad(100), -math.rad(10), -.2)
  1253. end
  1254. end
  1255. rm.C0 = clerp(rm.C0,rscf,speed)
  1256. lm.C0 = clerp(lm.C0,lscf,speed)
  1257. rj.C0 = clerp(rj.C0,rjcf,speed)
  1258. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  1259. llegm.C0 = clerp(llegm.C0,llcf,speed)
  1260. neck.C0 = clerp(neck.C0,ncf,speed)
  1261. end
  1262. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement