Advertisement
SetsunaElysia

Survivor Skript

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