RealPieDiePew

Untitled

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