rewr

Untitled

Sep 16th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.89 KB | None | 0 0
  1. plr = game:FindService'Players'.LocalPlayer
  2. char = plr.Character
  3. for i,v in pairs(plr:children()) do
  4. if v.Name == 'Coach' or v.Name == 'Rochelle' or v.Name == 'Ellis' or v.Name == 'Nick' then
  5. v:remove()
  6. end
  7. end
  8. if char:FindFirstChild'Animate' then
  9. char:FindFirstChild'Animate':remove()
  10. wait(0.1)
  11. end
  12. function ClearNotNeededStuff(parent)
  13. for i,v in pairs(parent:children()) do
  14. if v.ClassName == 'CharacterMesh' or v.ClassName == 'Hat' or v.ClassName == 'Shirt' or v.ClassName == 'Pants' or (v.ClassName == 'Decal' and v.Name ~= 'face') then
  15. v:remove()
  16. else
  17. ClearNotNeededStuff(v)
  18. end
  19. end
  20. end
  21. function getVelocity(p1,p2,speed)
  22. local dis=(p1-p2).magnitude
  23. if speed=="dis" then
  24. if dis*6>100 then
  25. speed=dis*6
  26. else
  27. speed=100
  28. end
  29. end
  30. local x=(p1.x-p2.x)/dis*speed
  31. local y=(p1.y-p2.y)/dis*speed
  32. local z=(p1.z-p2.z)/dis*speed
  33. return Vector3.new(-x,-y+10,-z)
  34. end
  35. ClearNotNeededStuff(char)
  36. ControllerService = game:GetService("ControllerService")
  37. Controllers = ControllerService:GetChildren()[1]
  38. mouse = plr:GetMouse()
  39. humanoid = char:findFirstChild("Humanoid")
  40. torso = char:findFirstChild("Torso")
  41. head = char.Head
  42. ra = char:findFirstChild("Right Arm")
  43. la = char:findFirstChild("Left Arm")
  44. rl = char:findFirstChild("Right Leg")
  45. ll = char:findFirstChild("Left Leg")
  46. rs = torso:findFirstChild("Right Shoulder")
  47. ls = torso:findFirstChild("Left Shoulder")
  48. rh = torso:findFirstChild("Right Hip")
  49. lh = torso:findFirstChild("Left Hip")
  50. neck = torso:findFirstChild("Neck")
  51. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  52. rootpart = char:findFirstChild("HumanoidRootPart")
  53. backpack = plr:FindFirstChild'Backpack'
  54. PlayerGui = plr:FindFirstChild'PlayerGui'
  55. MainScreenGui = Instance.new("ScreenGui",PlayerGui)
  56. MainFrame = Instance.new("Frame",MainScreenGui)
  57. MainFrame.Size = UDim2.new(0.2, 0,0.1, 0)
  58. MainFrame.Position = UDim2.new(0.79, 0,0.4, 0)
  59. MainFrame.BorderSizePixel = 0
  60. MainFrame.BackgroundColor3 = BrickColor.new'Institutional white'.Color
  61. GunNameTextLabel = Instance.new("TextLabel",MainFrame)
  62. GunNameTextLabel.BackgroundTransparency = 1
  63. GunNameTextLabel.Size = UDim2.new(1,0,0.5,0)
  64. GunNameTextLabel.Font = 'Legacy'
  65. GunNameTextLabel.TextScaled = true
  66. GunNameTextLabel.Text = 'Current weapon: None'
  67. AmmoTextLabel = Instance.new("TextLabel",MainFrame)
  68. AmmoTextLabel.BackgroundTransparency = 1
  69. AmmoTextLabel.Size = UDim2.new(1,0,0.5,0)
  70. AmmoTextLabel.Position = UDim2.new(0,0,0.5,0)
  71. AmmoTextLabel.Font = 'Legacy'
  72. AmmoTextLabel.TextScaled = true
  73. AmmoTextLabel.Text = 'Ammo amount: No weapon'
  74. pcall(function()
  75. game:FindService'Lighting':FindFirstChild'Pistol':Clone().Parent=backpack
  76. end)
  77. camera = workspace.CurrentCamera
  78. local climbing = false
  79. local rm = Instance.new("Motor", torso)
  80. rm.C0 = CFrame.new(1.5, 0.5, 0)
  81. rm.C1 = CFrame.new(0, 0.5, 0)
  82. rm.Part0 = torso
  83. rm.Part1 = ra
  84. rm.Name = "Right Shoulder"
  85. local lm = Instance.new("Motor", torso)
  86. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  87. lm.C1 = CFrame.new(0, 0.5, 0)
  88. lm.Part0 = torso
  89. lm.Part1 = la
  90. lm.Name = "Left Shoulder"
  91. local rlegm = Instance.new("Motor", torso)
  92. rlegm.C0 = CFrame.new(0.5, -1, 0)
  93. rlegm.C1 = CFrame.new(0, 1, 0)
  94. rlegm.Part0 = torso
  95. rlegm.Part1 = rl
  96. rlegm.Name = "Right Hip"
  97. local llegm = Instance.new("Motor", torso)
  98. llegm.C0 = CFrame.new(-0.5, -1, 0)
  99. llegm.C1 = CFrame.new(0, 1, 0)
  100. llegm.Part0 = torso
  101. llegm.Part1 = ll
  102. llegm.Name = "Left Hip"
  103. neck.C0 = CFrame.new(0, 1, 0)
  104. neck.C1 = CFrame.new(0, -0.5, 0)
  105. rj.C0 = CFrame.new(0, -1.5, 0)
  106. rj.C1 = CFrame.new(0, -1.5, 0)
  107. rsc0 = rm.C0
  108. lsc0 = lm.C0
  109. llc0 = llegm.C0
  110. rlc0 = rlegm.C0
  111. neckc0 = neck.C0
  112. rootc0 = rj.C0
  113. local angle = 0
  114. local anglespeed = 8
  115. local count = 0
  116. local countspeed = 16
  117. local action = 'none'
  118. local lastaction = 'none'
  119. local dancingtime = 0
  120. local idletime = 0
  121. local will_lay = false
  122. local hmesh = head:FindFirstChild'Mesh'
  123. hmesh:remove()
  124. hmesh = Instance.new('SpecialMesh',head)
  125. hmesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  126. hmesh.MeshType = 'Head'
  127. local notUsedPlayers = {
  128. ['Nick'] = 'notused',
  129. ['Rochelle'] = 'notused',
  130. ['Coach'] = 'notused',
  131. ['Ellis'] = 'notused'
  132. }
  133. local availablePlayerNames = {'Nick','Rochelle','Coach','Ellis'}
  134. function GetNotUsedPlayers()
  135. for i,v in pairs(game:FindService'Players':players()) do
  136. for j,k in pairs(notUsedPlayers) do
  137. if v:FindFirstChild(j) then
  138. notUsedPlayers[j] = 'used'
  139. end
  140. end
  141. end
  142. end
  143. GetNotUsedPlayers()
  144. local currentPlayer = nil
  145. for i,v in pairs(availablePlayerNames) do
  146. if currentPlayer ~= nil then break end
  147. if notUsedPlayers[v] == 'notused' then
  148. currentPlayer = v
  149. end
  150. end
  151. local asd = Instance.new("StringValue",plr)
  152. asd.Name = currentPlayer
  153. pcall(function()
  154. head.face.Texture = 'rbxasset://textures/face.png'
  155. end)
  156. rbxutil = LoadLibrary'RbxUtility'
  157. onToolSelected = rbxutil.CreateSignal()
  158. ToolSelected = nil
  159. for i,v in pairs(backpack:children()) do
  160. if v.ClassName == 'Tool' then
  161. if v:FindFirstChild'Handle' then
  162. v.Equipped:connect(function()
  163. onToolSelected:fire('selected',v)
  164. ToolSelected = v
  165. end)
  166. v.Unequipped:connect(function()
  167. onToolSelected:fire('unselected',v)
  168. ToolSelected = nil
  169. end)
  170. end
  171. end
  172. end
  173. backpack.ChildAdded:connect(function(what)
  174. if what.ClassName == 'Tool' then
  175. if what:FindFirstChild'Handle' then
  176. what.Equipped:connect(function()
  177. onToolSelected:fire('selected',what)
  178. ToolSelected = what
  179. end)
  180. what.Unequipped:connect(function()
  181. onToolSelected:fire('unselected',what)
  182. ToolSelected = nil
  183. end)
  184. end
  185. end
  186. end)
  187. currentShootConnection = nil
  188. MaxAmmuntition = {} --ye, spell mistake, don't judge it
  189. onToolSelected:connect(function(a,b)
  190. if a == 'selected' then
  191. if MaxAmmuntition[b.Name] == nil then
  192. MaxAmmuntition[b.Name] = b:FindFirstChild'Ammo'.Value
  193. end
  194. GunNameTextLabel.Text = 'Current weapon: '..b.Name
  195. AmmoTextLabel.Text = 'Ammo amount: '..b:FindFirstChild'Ammo'.Value or 'Ammo amount: No ammo'
  196. currentShootConnection = b.Activated:connect(function()
  197. if b:FindFirstChild'Ammo'.Value > 0 then
  198. b:FindFirstChild'Ammo'.Value = b:FindFirstChild'Ammo'.Value-1
  199. AmmoTextLabel.Text = 'Ammo amount: '..b:FindFirstChild'Ammo'.Value or 'Ammo amount: No ammo'
  200. local bullet = Instance.new("Part",workspace)
  201. bullet.Name = 'Bullet'
  202. bullet.TopSurface = 0
  203. bullet.BottomSurface = 0
  204. bullet.FormFactor = 'Custom'
  205. bullet.CFrame = b:FindFirstChild'Handle'.CFrame
  206. bullet.CanCollide = false
  207. bullet.Velocity = getVelocity(bullet.Position, mouse.Hit.p, 500)
  208. local bulletmesh = b:FindFirstChild'BulletMesh':Clone()
  209. bulletmesh.Parent=bullet
  210. bullet.Touched:connect(function(toucher)
  211. if toucher.Parent:findFirstChild'Head' and toucher.Parent:findFirstChild'Torso' and toucher.Parent.Name ~= plr.Name then
  212. bullet:remove()
  213. for i,v in pairs(toucher.Parent:children()) do
  214. if v.ClassName == 'Humanoid' then
  215. if v.Health > 100 then
  216. v.Health = 100
  217. else
  218. v.Health = v.Health - math.random(b:FindFirstChild'MinDamage'.Value,b:FindFirstChild'MaxDamage'.Value)
  219. end
  220. end
  221. end
  222. end
  223. end)
  224. else
  225. action = 'reloading'
  226. end
  227. end)
  228. else
  229. GunNameTextLabel.Text = 'Current weapon: None'
  230. AmmoTextLabel.Text = 'Ammo amount: No weapon'
  231. pcall(function()
  232. currentShootConnection:disconnect()
  233. end)
  234. end
  235. end)
  236. local fakehead = head:clone()
  237. fakehead.Parent = char
  238. fakehead.TopSurface = 'SmoothNoOutlines'
  239. fakehead.BottomSurface = 'SmoothNoOutlines'
  240. fakehead.RightSurface = 'SmoothNoOutlines'
  241. fakehead.LeftSurface = 'SmoothNoOutlines'
  242. fakehead.FrontSurface = 'SmoothNoOutlines'
  243. fakehead.BackSurface = 'SmoothNoOutlines'
  244. fakehead.BrickColor = currentPlayer=='Rochelle' and BrickColor.new'Brown' or currentPlayer == 'Nick' and BrickColor.new'Pastel brown' or currentPlayer=='Ellis' and BrickColor.new'Pastel brown' or currentPlayer=='Coach' and BrickColor.new'Brown'
  245. fakehead.Name = 'FakeHead'
  246. head.Transparency = 1
  247. local faketorso = torso:clone()
  248. faketorso.Parent = char
  249. faketorso.Name = 'FakeTorso'
  250. faketorso.TopSurface = 'SmoothNoOutlines'
  251. faketorso.BottomSurface = 'SmoothNoOutlines'
  252. faketorso.RightSurface = 'SmoothNoOutlines'
  253. faketorso.LeftSurface = 'SmoothNoOutlines'
  254. faketorso.FrontSurface = 'SmoothNoOutlines'
  255. faketorso.BackSurface = 'SmoothNoOutlines'
  256. faketorso.BrickColor = currentPlayer=='Rochelle' and BrickColor.new'Hot pink' or currentPlayer == 'Nick' and BrickColor.new'Institutional white' or currentPlayer=='Ellis' and BrickColor.new'White' or currentPlayer=='Coach' and BrickColor.new'Medium green'
  257. torso.Transparency = 1
  258. local fakela = la:Clone()
  259. fakela.Parent = char
  260. fakela.TopSurface = 'SmoothNoOutlines'
  261. fakela.BottomSurface = 'SmoothNoOutlines'
  262. fakela.RightSurface = 'SmoothNoOutlines'
  263. fakela.LeftSurface = 'SmoothNoOutlines'
  264. fakela.FrontSurface = 'SmoothNoOutlines'
  265. fakela.BackSurface = 'SmoothNoOutlines'
  266. fakela.BrickColor = currentPlayer=='Rochelle' and BrickColor.new'Brown' or currentPlayer == 'Nick' and BrickColor.new'Institutional white' or currentPlayer=='Ellis' and BrickColor.new'Pastel brown' or currentPlayer=='Coach' and BrickColor.new'Brown'
  267. fakela.Name = 'FakeLeft Arm'
  268. la.Transparency = 1
  269. local fakera = ra:Clone()
  270. fakera.Parent = char
  271. fakera.TopSurface = 'SmoothNoOutlines'
  272. fakera.BottomSurface = 'SmoothNoOutlines'
  273. fakera.RightSurface = 'SmoothNoOutlines'
  274. fakera.LeftSurface = 'SmoothNoOutlines'
  275. fakera.FrontSurface = 'SmoothNoOutlines'
  276. fakera.BackSurface = 'SmoothNoOutlines'
  277. fakera.BrickColor = currentPlayer=='Rochelle' and BrickColor.new'Brown' or currentPlayer == 'Nick' and BrickColor.new'Institutional white' or currentPlayer=='Ellis' and BrickColor.new'Pastel brown' or currentPlayer=='Coach' and BrickColor.new'Brown'
  278. fakera.Name = 'FakeRight Arm'
  279. ra.Transparency = 1
  280. local fakerl = rl:Clone()
  281. fakerl.Parent = char
  282. fakerl.TopSurface = 'SmoothNoOutlines'
  283. fakerl.BottomSurface = 'SmoothNoOutlines'
  284. fakerl.RightSurface = 'SmoothNoOutlines'
  285. fakerl.LeftSurface = 'SmoothNoOutlines'
  286. fakerl.FrontSurface = 'SmoothNoOutlines'
  287. fakerl.BackSurface = 'SmoothNoOutlines'
  288. fakerl.BrickColor = currentPlayer=='Rochelle' and BrickColor.new'Black' or currentPlayer == 'Nick' and BrickColor.new'Institutional white' or currentPlayer=='Ellis' and BrickColor.new'Really black' or currentPlayer=='Coach' and BrickColor.new'Brick yellow'
  289. fakerl.Name = 'FakeRight Leg'
  290. rl.Transparency = 1
  291. local fakell = ll:Clone()
  292. fakell.Parent = char
  293. fakell.TopSurface = 'SmoothNoOutlines'
  294. fakell.BottomSurface = 'SmoothNoOutlines'
  295. fakell.RightSurface = 'SmoothNoOutlines'
  296. fakell.LeftSurface = 'SmoothNoOutlines'
  297. fakell.FrontSurface = 'SmoothNoOutlines'
  298. fakell.BackSurface = 'SmoothNoOutlines'
  299. fakell.BrickColor = currentPlayer=='Rochelle' and BrickColor.new'Black' or currentPlayer == 'Nick' and BrickColor.new'Institutional white' or currentPlayer=='Ellis' and BrickColor.new'Really black' or currentPlayer=='Coach' and BrickColor.new'Brick yellow'
  300. fakell.Name = 'FakeRight Leg'
  301. ll.Transparency = 1
  302. pcall(function()
  303. head.face:remove()
  304. end)
  305. local lol = Instance.new("BillboardGui",fakehead)
  306. lol.StudsOffset = Vector3.new(0,2,0)
  307. lol.Size = UDim2.new(8,0,7,0)
  308. local lol2 = Instance.new("TextLabel",lol)
  309. lol2.Size = UDim2.new(1,0,1,0)
  310. lol2.Text = currentPlayer
  311. lol2.TextColor = currentPlayer=='Nick' and BrickColor.new("Really blue") or currentPlayer=='Ellis' and BrickColor.new('Light blue') or currentPlayer=='Rochelle' and BrickColor.new('Hot pink') or currentPlayer=='Coach' and BrickColor.new("Brown")
  312. lol2.BackgroundTransparency = 1
  313. lol2.TextScaled = false
  314. lol2.Font = 'Legacy'
  315. lol2.FontSize = 'Size24'
  316. local fakeweld = Instance.new("Weld", fakehead)
  317. fakeweld.Part0 = head
  318. fakeweld.Part1 = fakehead
  319. local fakeweld2 = Instance.new("Weld", faketorso)
  320. fakeweld2.Part0 = torso
  321. fakeweld2.Part1 = faketorso
  322. local fakeweld3 = Instance.new("Weld", fakera)
  323. fakeweld3.Part0 = ra
  324. fakeweld3.Part1 = fakera
  325. local fakeweld4 = Instance.new("Weld", fakela)
  326. fakeweld4.Part0 = la
  327. fakeweld4.Part1 = fakela
  328. local fakeweld5 = Instance.new("Weld", fakerl)
  329. fakeweld5.Part0 = rl
  330. fakeweld5.Part1 = fakerl
  331. local fakeweld6 = Instance.new("Weld", fakell)
  332. fakeweld6.Part0 = ll
  333. fakeweld6.Part1 = fakell
  334. if currentPlayer == 'Ellis' then
  335. local a = Instance.new("Hat",char)
  336. a.Name = 'Cap'
  337. a.AttachmentUp = Vector3.new(0, 1, 0)
  338. a.AttachmentRight = Vector3.new(1, 0, 0)
  339. a.AttachmentPos = Vector3.new(0, 0, 0)
  340. a.AttachmentForward = Vector3.new(0, 0, -1)
  341. local b = Instance.new("Part",a)
  342. b.Name = 'Handle'
  343. local c = Instance.new("SpecialMesh",b)
  344. c.TextureId = 'http://www.roblox.com/asset/?id=17424198'
  345. c.Name = 'Hat mesh'
  346. c.Scale = Vector3.new(1.05, 1.05, 1.05)
  347. c.MeshType = 'FileMesh'
  348. c.MeshId = 'http://www.roblox.com/asset/?id=16190466'
  349. elseif currentPlayer == 'Nick' then
  350. local a = Instance.new("Hat",char)
  351. a.Name = 'Tie'
  352. a.AttachmentPos = Vector3.new(0, 1.9, 0.55)
  353. local b = Instance.new("Part",a)
  354. b.Name = 'Handle'
  355. b.BrickColor = BrickColor.new'Really blue'
  356. local c = Instance.new("SpecialMesh",b)
  357. c.Scale = Vector3.new(1.4, 1.2, 1.4)
  358. c.MeshType = 'FileMesh'
  359. c.MeshId = 'http://www.roblox.com/asset/?id=28463033'
  360. c.TextureId = ''
  361. local a2 = Instance.new("Hat",char)
  362. a2.Name = 'Hair'
  363. a2.AttachmentPos = Vector3.new(0,0,0)
  364. local b2 = Instance.new("Part",a2)
  365. b2.Name = 'Handle'
  366. b2.BrickColor = BrickColor.new'Really black'
  367. local c2 = Instance.new("SpecialMesh",b2)
  368. c2.MeshType = 'FileMesh'
  369. c2.MeshId = 'http://www.roblox.com/asset/?id=1095708'
  370. c2.Scale = Vector3.new(1, 1, 1.9)
  371. elseif currentPlayer == 'Rochelle' then
  372. local a = Instance.new("Hat",char)
  373. a.AttachmentPos = Vector3.new(0,0.3,0.1)
  374. a.Name = 'Hair'
  375. local b = Instance.new("Part",a)
  376. b.Name = 'Handle'
  377. b.BrickColor = BrickColor.new'Really black'
  378. local c = Instance.new("SpecialMesh",b)
  379. c.MeshType = 'FileMesh'
  380. c.MeshId = 'http://www.roblox.com/asset/?id=13070796'
  381. c.Scale = Vector3.new(1, 0.5, 1)
  382. end
  383. function clerp(c1,c2,al)
  384. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  385. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  386. for i,v in pairs(com1) do
  387. com1[i] = v+(com2[i]-v)*al
  388. end
  389. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  390. end
  391. humanoid.Jumping:connect(function()
  392. action = 'jumping'
  393. Controllers.Parent = nil
  394. end)
  395. humanoid.Died:connect(function()
  396. repeat Controllers.Parent = ControllerService wait() until nil
  397. pcall(function()
  398. plr:FindFirstChild(currentPlayer):remove()
  399. end)
  400. end)
  401. mouse.KeyDown:connect(function(key)
  402. if key:byte() == 48 then
  403. action = 'running'
  404. end
  405. if key == '2' or key == 'c' then
  406. action = action == 'crouch' and 'none' or 'crouch'
  407. end
  408. if key == 'r' then
  409. pcall(function()
  410. if ToolSelected:FindFirstChild'Ammo'.Value ~= MaxAmmuntition[ToolSelected.Name] then
  411. action = 'reloading'
  412. end
  413. end)
  414. end
  415. end)
  416. mouse.KeyUp:connect(function(key)
  417. if key:byte() == 48 then
  418. if action == 'running' then
  419. action = 'none'
  420. end
  421. end
  422. end)
  423. plr.Chatted:connect(function(chat)
  424. local emote = false
  425. if chat:sub(1,3) == '/e ' then
  426. emote = true
  427. chat = chat:sub(4)
  428. elseif chat:sub(1,7) == '/emote ' then
  429. emote = true
  430. chat = chat:sub(8)
  431. end
  432. if emote == true then
  433. if chat == 'dance' then
  434. action = 'dance'
  435. elseif chat == 'sit' then
  436. action = 'sit'
  437. elseif chat == 'lay' then
  438. if action ~= 'lay' then
  439. will_lay = true
  440. action = 'sit'
  441. end
  442. elseif chat == 'wave' then
  443. action = 'wave'
  444. elseif chat == 'squat' then
  445. action = 'squat'
  446. elseif chat == 'point' then
  447. action = 'point'
  448. end
  449. end
  450. end)
  451. while wait() do
  452. humanoid.WalkSpeed = (action == 'running' or lastaction == 'running') and 30 or (action == 'crouch' or lastaction == 'crouch') and 5 or 10
  453. torso.Anchored = false
  454. local rscf = rsc0
  455. local lscf = lsc0
  456. local rlcf = rlc0
  457. local llcf = llc0
  458. local rjcf = rootc0
  459. local ncf = neckc0
  460. local speed = 0.2
  461. local rayHit = false
  462. angle = (angle % 100) + anglespeed/10
  463. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  464. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -3.95, 0))
  465. local hitz, enz = workspace:findPartOnRay(rayz, char)
  466. local rayz1 = Ray.new(rootpart.Position, Vector3.new(-.5, -3.95, 0))
  467. local hitz1, enz1 = workspace:findPartOnRay(rayz1, char)
  468. local rayz2 = Ray.new(rootpart.Position, Vector3.new(.5, -3.95, 0))
  469. local hitz2, enz2 = workspace:findPartOnRay(rayz2, char)
  470. local rayz3 = Ray.new(rootpart.Position, Vector3.new(0, -3.95, -.5))
  471. local hitz3, enz3 = workspace:findPartOnRay(rayz3, char)
  472. local rayz4 = Ray.new(rootpart.Position, Vector3.new(0, -3.95, .5))
  473. local hitz4, enz4 = workspace:findPartOnRay(rayz4, char)
  474. local rotvellimit = action~='running' and 2 or 10
  475. local rotvel = torso.RotVelocity.y
  476. if rotvel > rotvellimit then
  477. rotvel = rotvellimit
  478. elseif rotvel < -rotvellimit then
  479. rotvel = -rotvellimit
  480. end
  481. if hitz or hitz1 or hitz2 or hitz3 or hitz4 then
  482. Controllers.Parent = ControllerService
  483. end
  484. if action == 'reloading' then
  485. if ToolSelected == nil then
  486. action = lastaction == 'crouch' and 'crouch' or lastaction == 'running' and 'running' or 'none'
  487. end
  488. if action == 'reloading' then
  489. humanoid.WalkSpeed = 0
  490. Controllers.Parent = nil
  491. speed = 0.2
  492. for waiting = 0,20 do
  493. if lastaction ~= 'crouch' then
  494. rjcf = rootc0
  495. lscf = lsc0 * CFrame.new(0.4,0,0) * CFrame.Angles(math.rad(90),0,math.rad(45))
  496. rscf = rsc0 * CFrame.new(-0.4,0,0) * CFrame.Angles(math.rad(95),0,math.rad(-45))
  497. ncf = neckc0 * CFrame.Angles(math.rad(-15),0,0)
  498. rlcf = rlc0 * CFrame.Angles(0,0,math.rad(5))
  499. llcf = llc0 * CFrame.Angles(0,0,math.rad(-5))
  500. rm.C0 = clerp(rm.C0,rscf,speed)
  501. lm.C0 = clerp(lm.C0,lscf,speed)
  502. rj.C0 = clerp(rj.C0,rjcf,speed)
  503. neck.C0 = clerp(neck.C0,ncf,speed)
  504. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  505. llegm.C0 = clerp(llegm.C0,llcf,speed)
  506. else
  507. ncf = neckc0 * CFrame.Angles(math.rad(-15),0,0)
  508. rscf = rsc0 * CFrame.new(-0.4,0,0) * CFrame.Angles(math.rad(95),0,math.rad(-45))
  509. lscf = lsc0 * CFrame.new(0.4,0,0) * CFrame.Angles(math.rad(90),0,math.rad(45))
  510. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  511. llcf = llc0 * CFrame.new(0, 0, -.4999) * CFrame.Angles(-math.pi/2.2, 0, 0)
  512. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  513. rm.C0 = clerp(rm.C0,rscf,speed)
  514. lm.C0 = clerp(lm.C0,lscf,speed)
  515. rj.C0 = clerp(rj.C0,rjcf,speed)
  516. neck.C0 = clerp(neck.C0,ncf,speed)
  517. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  518. llegm.C0 = clerp(llegm.C0,llcf,speed)
  519. end
  520. wait()
  521. end
  522. pcall(function()
  523. ToolSelected:FindFirstChild'Ammo'.Value = MaxAmmuntition[ToolSelected.Name]
  524. end)
  525. pcall(function()
  526. AmmoTextLabel.Text = 'Ammo amount: '..ToolSelected:FindFirstChild'Ammo'.Value or 'Ammo amount: No weapon'
  527. end)
  528. Controllers.Parent = ControllerService
  529. humanoid.WalkSpeed = 16
  530. action = lastaction == 'crouch' and 'crouch' or 'none'
  531. end
  532. end
  533. if humanoid.Sit then
  534. if action == 'dance' then action = lastaction end
  535. rjcf = rootc0
  536. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  537. lscf = lsc0 * CFrame.Angles(math.rad(90),0,0)
  538. rlcf = rlc0 * CFrame.Angles(math.rad(90),0,math.rad(15))
  539. llcf = llc0 * CFrame.Angles(math.rad(90),0,math.rad(-15))
  540. ncf = neckc0
  541. elseif action == 'sit' then
  542. if Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 2 then action = 'none' end
  543. if will_lay ~= true then
  544. rjcf = rootc0 * CFrame.new(0,-1.5,0) * CFrame.Angles(math.rad(25),0,0)
  545. rscf = rsc0 * CFrame.Angles(math.rad(-25),0,0)
  546. lscf = lsc0 * CFrame.Angles(math.rad(-25),0,0)
  547. rlcf = rlc0 * CFrame.Angles(math.rad(65),0,math.rad(15))
  548. llcf = llc0 * CFrame.Angles(math.rad(65),0,math.rad(-15))
  549. else
  550. rjcf = rootc0 * CFrame.new(0,-1.5,0) * CFrame.Angles(math.rad(25),0,0)
  551. rscf = rsc0 * CFrame.Angles(math.rad(-25),0,0)
  552. lscf = lsc0 * CFrame.Angles(math.rad(-25),0,0)
  553. rlcf = rlc0 * CFrame.Angles(math.rad(65),0,math.rad(15))
  554. llcf = llc0 * CFrame.Angles(math.rad(65),0,math.rad(-15))
  555. rm.C0 = clerp(rm.C0,rscf,speed)
  556. lm.C0 = clerp(lm.C0,lscf,speed)
  557. rj.C0 = clerp(rj.C0,rjcf,speed)
  558. neck.C0 = clerp(neck.C0,ncf,speed)
  559. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  560. llegm.C0 = clerp(llegm.C0,llcf,speed)
  561. wait()
  562. will_lay = false
  563. action = 'lay'
  564. end
  565. elseif action == 'lay' then
  566. if Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 2 then action = 'none' end
  567. rjcf = rootc0 * CFrame.new(0,-1.5,0) * CFrame.Angles(math.rad(90),0,0)
  568. rscf = rsc0 * CFrame.Angles(0,0,math.rad(105))
  569. lscf = lsc0 * CFrame.Angles(0,0,math.rad(-105))
  570. rlcf = rlc0 * CFrame.Angles(0,0,math.rad(15))
  571. llcf = llc0 * CFrame.Angles(0,0,math.rad(-15))
  572. elseif action == 'wave' then
  573. if Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 2 then action = 'none' end
  574. anglespeed = 1
  575. speed = 0.25
  576. rjcf = rootc0 * CFrame.Angles(0,math.rad(45),0)
  577. ncf = neckc0 * CFrame.Angles(0,math.rad(-45),0)
  578. lscf = lsc0 * CFrame.Angles(0,0,math.rad(-15))
  579. rlcf = rlc0 * CFrame.Angles(0,0,math.rad(5))
  580. llcf = llc0 * CFrame.Angles(0,0,math.rad(-5))
  581. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.008, math.pi/1.4+math.sin(angle)*.5)
  582. elseif action == 'squat' then
  583. if Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 2 then action = 'none' end
  584. anglespeed = 0.15
  585. speed = 0.25
  586. ncf = neckc0 * CFrame.Angles(math.pi/12-math.sin(angle)*0.005,0,0)
  587. 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)
  588. 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)
  589. rjcf = rootc0 * CFrame.new(0, -0.9, 0.55) * CFrame.Angles(-math.pi/12+math.sin(angle)*0.005, 0, 0)
  590. llcf = llc0 * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/12, 0, -math.rad(2))
  591. rlcf = rlcf * CFrame.new(0, .95, -.55) * CFrame.Angles(math.pi/14, 0, math.rad(2))
  592. elseif action == 'point' then
  593. if Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 2 then action = 'none' end
  594. anglespeed = 0.5
  595. speed = 0.25
  596. rjcf = rootc0 * CFrame.Angles(0,math.rad(45),0)
  597. ncf = neckc0 * CFrame.Angles(0,math.rad(-45),0)
  598. rscf = rsc0 * CFrame.Angles(math.rad(90),0,math.rad(45))
  599. lscf = lsc0 * CFrame.Angles(0,0,math.rad(-15))
  600. rlcf = rlc0 * CFrame.Angles(0,0,math.rad(5))
  601. llcf = llc0 * CFrame.Angles(0,0,math.rad(-5))
  602. elseif action == 'dance' then
  603. if Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 2 then action = 'none' end
  604. dancingtime = dancingtime + 1/60
  605. anglespeed = 1
  606. speed = 0.25
  607. if dancingtime <= 12 then
  608. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  609. rjcf = rootc0 * CFrame.new(0, 0.75 + -math.abs(math.sin(angle)), 0) * CFrame.Angles(0, 0, math.sin(angle)*.1)
  610. rscf = rsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, math.rad(2))
  611. lscf = lsc0 * CFrame.Angles(math.pi-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
  612. rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.25, 0, math.rad(5))
  613. llcf = llc0 * CFrame.Angles(-math.sin(angle)*.25, 0, -math.rad(5))
  614. elseif dancingtime <= 22 then
  615. ncf = neckc0 * CFrame.Angles(math.pi/24.85, 0, 0)
  616. rjcf = rootc0 * CFrame.new(0, math.abs(math.cos(angle)*.05), 0) * CFrame.Angles(0, math.sin(angle)*.035, math.sin(angle)*.015)
  617. rscf = rsc0 * CFrame.Angles(math.pi/2-math.abs(math.sin(angle))*.5, 0, math.rad(2))
  618. lscf = lsc0 * CFrame.Angles(math.pi/2-math.abs(math.sin(angle))*.5, 0, -math.rad(2))
  619. rlcf = rlc0 * CFrame.Angles(math.sin(angle)*.05, 0, math.rad(5))
  620. llcf = llc0 * CFrame.Angles(-math.sin(angle)*.05, 0, -math.rad(5))
  621. elseif dancingtime >= 22 then
  622. dancingtime = 0
  623. end
  624. elseif action == 'jumping' then
  625. anglespeed = 1
  626. speed = 0.175
  627. rayHit = false
  628. for waiting = 0, 8 do
  629. rjcf = rootc0 * CFrame.Angles(lastaction=='running' and math.rad(-15) or 0, 0, 0)
  630. rscf = rsc0 * CFrame.Angles(0, 0, math.rad(15))
  631. lscf = lsc0 * CFrame.Angles(0, 0, math.rad(-15))
  632. rlcf = rlc0 * CFrame.new(0, 0.5, -0.5) * CFrame.Angles(math.rad(-15), 0, 0)
  633. llcf = llc0 * CFrame.Angles(0, 0, 0)
  634. ncf = neckc0 * CFrame.Angles(lastaction=='running' and math.rad(15) or 0,0,0)
  635. rm.C0 = clerp(rm.C0,rscf,speed)
  636. lm.C0 = clerp(lm.C0,lscf,speed)
  637. rj.C0 = clerp(rj.C0,rjcf,speed)
  638. neck.C0 = clerp(neck.C0,ncf,speed)
  639. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  640. llegm.C0 = clerp(llegm.C0,llcf,speed)
  641. wait()
  642. end
  643. action = (lastaction ~= 'dance' and lastaction ~= 'sit' and lastaction ~= 'lay') and lastaction or 'none'
  644. elseif not hitz and not hitz1 and not hitz2 and not hitz4 then
  645. if action == 'dance' then action = 'none' end
  646. anglespeed = 1
  647. speed = 0.175
  648. rjcf = rootc0 * CFrame.Angles(math.rad(-15),0,0)
  649. rscf = rsc0 * CFrame.Angles(0, 0, math.rad(15))
  650. lscf = lsc0 * CFrame.Angles(0, 0, math.rad(-15))
  651. rlcf = rlc0 * CFrame.new(0, 0.5, -0.5) * CFrame.Angles(math.rad(-15), 0, 0)
  652. llcf = llc0 * CFrame.Angles(0, 0, 0)
  653. ncf = neckc0 * CFrame.Angles(math.rad(15),0,0)
  654. elseif Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude < 2 then
  655. anglespeed = 0.3
  656. speed = 0.15
  657. if action ~= 'crouch' then
  658. idletime = idletime + 1/30
  659. if idletime < 12 then
  660. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  661. rjcf = rootc0 * CFrame.Angles(0, 0, 0)
  662. if ToolSelected == nil then
  663. rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.08, 0, 0)
  664. else
  665. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  666. end
  667. lscf = lsc0 * CFrame.Angles(math.sin(angle)*0.08, 0, 0)
  668. rlcf = rlc0 * CFrame.Angles(0, 0, math.rad(2.5))
  669. llcf = llc0 * CFrame.Angles(0, 0, -math.rad(2.5))
  670. elseif idletime < 22 then
  671. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  672. rjcf = rootc0 * CFrame.Angles(0, 0, 0)
  673. if ToolSelected == nil then
  674. rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.08, 0, 0)
  675. else
  676. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  677. end
  678. lscf = lsc0 * CFrame.Angles(math.sin(angle)*0.08, 0, 0)
  679. rlcf = rlc0 * CFrame.Angles(0, 0, math.rad(2.5))
  680. llcf = llc0 * CFrame.Angles(0, 0, -math.rad(2.5))
  681. else
  682. idletime = 0
  683. end
  684. else
  685. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  686. if ToolSelected == nil then
  687. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, math.pi/18)
  688. else
  689. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  690. end
  691. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, -math.pi/18)
  692. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  693. llcf = llc0 * CFrame.new(0, 0, -.4999) * CFrame.Angles(-math.pi/2.2, 0, 0)
  694. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  695. end
  696. elseif Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude <= 20 then
  697. if action == 'dance' then action = 'none' end
  698. anglespeed = 1.5
  699. speed = 0.25
  700. if action ~= 'crouch' then
  701. rjcf = rootc0 * CFrame.Angles(0,0,math.rad(rotvel)*2.5)
  702. if ToolSelected == nil then
  703. rscf = rsc0 * CFrame.Angles(math.sin(angle),0,0)
  704. else
  705. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  706. end
  707. lscf = lsc0 * CFrame.Angles(math.sin(-angle),0,0)
  708. rlcf = rlc0 * CFrame.Angles(math.sin(-angle),0,0)
  709. llcf = llc0 * CFrame.Angles(math.sin(angle),0,0)
  710. ncf = neckc0
  711. else
  712. speed = 0.25
  713. ncf = neckc0 * CFrame.Angles(math.pi/12,0,0)
  714. if ToolSelected == nil then
  715. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.025) * CFrame.Angles(math.rad(45), 0, math.pi/18)
  716. else
  717. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  718. end
  719. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.025) * CFrame.Angles(math.rad(-45), 0, -math.pi/18)
  720. rjcf = rootc0 * CFrame.new(0, -.7, 0) * CFrame.Angles(math.abs(math.sin(angle))*0.025 + -math.pi/12, 0, 0)
  721. 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)
  722. 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)
  723. end
  724. elseif Vector3.new(torso.Velocity.x,0,torso.Velocity.z).magnitude > 20 then
  725. if action == 'dance' then action = 'none' end
  726. anglespeed = 2
  727. speed = .3
  728. rjcf = rootc0 * CFrame.Angles(math.rad(-15),0,math.rad(rotvel)*2.5)
  729. if ToolSelected == nil then
  730. rscf = rsc0 * CFrame.Angles(math.sin(angle),0,0)
  731. else
  732. rscf = rsc0 * CFrame.Angles(math.rad(90),0,0)
  733. end
  734. lscf = lsc0 * CFrame.Angles(math.sin(-angle),0,0)
  735. rlcf = rlc0 * CFrame.Angles(math.sin(-angle),0,0)
  736. llcf = llc0 * CFrame.Angles(math.sin(angle),0,0)
  737. ncf = neckc0 * CFrame.Angles(math.rad(15),0,0)
  738. end
  739. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  740. llegm.C0 = clerp(llegm.C0,llcf,speed)
  741. neck.C0 = clerp(neck.C0,ncf,speed)
  742. lm.C0 = clerp(lm.C0,lscf,speed)
  743. rm.C0 = clerp(rm.C0,rscf,speed)
  744. rj.C0 = clerp(rj.C0,rjcf,speed)
  745. lastaction = action
  746. end
  747. --[[
  748. ]]
Add Comment
Please, Sign In to add comment