Advertisement
Deyer

Untitled

Apr 27th, 2023
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.34 KB | None | 0 0
  1. --[[Converted By Keyer]]--
  2. --[[Suggested by ?????]]--
  3.  
  4. game.Players.LocalPlayer.Character.Torso.Anchored = true
  5.  
  6. game.Players.LocalPlayer.Character["Necklace"].Handle.Mesh:Destroy()
  7. loadstring(game:HttpGet("https://pastebin.com/raw/jAGzwsBB"))()
  8.  
  9. game.Players.LocalPlayer.Character.Torso.Anchored = false
  10. local lp = game:GetService("Players").LocalPlayer
  11. local rs = game:GetService("RunService")
  12. local stepped = rs.Stepped
  13. local heartbeat = rs.Heartbeat
  14. local renderstepped = rs.RenderStepped
  15. local sg = game:GetService("StarterGui")
  16. local ws = game:GetService("Workspace")
  17. local cf = CFrame.new
  18. local v3 = Vector3.new
  19. local v3_0 = Vector3.zero
  20. local inf = math.huge
  21.  
  22. local cplayer = lp.Character
  23.  
  24. local v3 = Vector3.new
  25.  
  26. local function gp(parent, name, className)
  27. if typeof(parent) == "Instance" then
  28. for i, v in pairs(parent:GetChildren()) do
  29. if (v.Name == name) and v:IsA(className) then
  30. return v
  31. end
  32. end
  33. end
  34. return nil
  35. end
  36.  
  37. local hat2 = gp(cplayer, "Necklace", "Accessory")
  38. local handle2 = gp(hat2, "Handle", "BasePart")
  39. local att2 = gp(handle2, "att1_Handle", "Attachment")
  40. att2.Parent = cplayer["Right Arm"]
  41. att2.Position = Vector3.new(-0.3, -1, -0.7)
  42. att2.Rotation = Vector3.new(90, 0, 0)
  43.  
  44. local ORIGCF=CFrame.new
  45. local math=setmetatable({random=function(Arg1,Arg2,DIV) DIV=DIV or 1 return math.random(Arg1*DIV,Arg2*DIV)/DIV end;CosSin=function(Arg) return (math.sin(Arg/2)*math.cos(Arg/2)) end;},{__index=math;})
  46. local CFrame=setmetatable({new=function(Arg1,Arg2,Arg3,Angles) if not Angles then return CFrame.new(Arg1,Arg2,Arg3) else return CFrame.Angles(math.rad(Arg1),math.rad(Arg2),math.rad(Arg3)) end end;},{__index=CFrame;})
  47. local Instance=setmetatable({new = function(type,args) local instance = Instance.new(type) pcall(function() if args then if string.lower(typeof(args)) == "instance" then instance.Parent = args elseif string.lower(typeof(args)) == "table" then for i,v in pairs(args) do pcall(function() instance[i] = v end) end end end end) return instance end;Remove=function(Instance_,Time) if string.lower(typeof(Instance_))=="instance" then game:GetService("Debris"):AddItem(Instance_,Time or 0) elseif string.lower(typeof(Instance_))=="table" then table.foreach(Instance_,function(_,v) game:GetService("Debris"):AddItem(v,Time or 0) end) end end},{__index=Instance;})
  48. local Player,Mouse = game.Players.LocalPlayer,game.Players.LocalPlayer:GetMouse()
  49.  
  50. --}{ Default Functions }{--
  51. local ins=Instance.new
  52. local v3=Vector3.new
  53. local v2=Vector2.new
  54. local cf=CFrame.new
  55. local angles=CFrame.Angles
  56. local ud=UDim.new
  57. local ud2=UDim2.new
  58. local c3=Color3.new
  59. local rgb=Color3.fromRGB
  60. local hsv=Color3.fromHSV
  61. local bc=BrickColor.new
  62. local bcRandom=BrickColor.Random
  63. local palette=BrickColor.palatte
  64. local cs=ColorSequence.new
  65. local ns=NumberSequence.new
  66. local nsk=NumberSequenceKeypoint.new
  67. local nr=NumberRange.new
  68. local random=math.random
  69. local rad=math.rad
  70. local sin=math.sin
  71. local cos=math.cos
  72. local tan=math.tan
  73. local CosSin=math.CosSin
  74. local floor=math.floor
  75. local pi=math.floor
  76. local abs=math.abs
  77. local sqrt=math.sqrt
  78. local clamp=math.clamp
  79. local ray=Ray.new
  80. local huge=math.huge
  81. --}{ Useful Functions }{--
  82. function Tween(Object,Args,Info)
  83. if Object and Args then
  84. Info = Info or TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
  85. if typeof(Info) == "table" then Info = TweenInfo.new(unpack(Info)) end
  86. game:GetService("TweenService"):Create(Object,Info,Args):Play()
  87. end
  88. end
  89. function Sound(Id,Volume,Pitch,Parent,MaxDistance,EmitterSize,Looped)
  90. local S=ins("Sound",{Volume=Volume or 1;Pitch=Pitch or 1;MaxDistance=MaxDistance or 500;EmitterSize=EmitterSize or 5;Looped=Looped or false;SoundId="rbxassetid://"..Id,Parent=Parent})
  91. S:Play()
  92. coroutine.wrap(function()
  93. if S.Looped then return end
  94. if S.IsLoaded then
  95. Instance.Remove(S,S.TimeLength/S.Pitch)
  96. else
  97. S.Loaded:Connect(function()
  98. Instance.Remove(S,S.TimeLength/S.Pitch)
  99. end)
  100. end
  101. end)()
  102. return S
  103. end
  104. function Raycast(Origin,Direction,Blacklist,MaxDistance,IgnoreWater)
  105. return workspace:FindPartOnRayWithIgnoreList(ray(Origin,Direction.Unit*MaxDistance),Blacklist or {},false,IgnoreWater)
  106. end
  107. --}{ Character }{--
  108. local char=Player.Character
  109. local hum=char:FindFirstChildOfClass("Humanoid")
  110. local h=char.Head
  111. local t=char.Torso
  112. local hrp=char.HumanoidRootPart
  113. local ra=char["Right Arm"]
  114. local la=char["Left Arm"]
  115. local rl=char["Right Leg"]
  116. local ll=char["Left Leg"]
  117. local nec=t.Neck
  118. local rutj=hrp.RootJoint
  119. local rs=t["Right Shoulder"]
  120. local ls=t["Left Shoulder"]
  121. local rh=t["Right Hip"]
  122. local lh=t["Left Hip"]
  123. local Bullets=ins("Model",{Name="Bullets";Parent=char;})
  124. --}{ Character Funtions }{--
  125. local Hats={}
  126. local Clothes={}
  127. table.foreach(char:GetChildren(),function(_,v) if v:IsA("Accessory") or v:IsA("Hat") then table.insert(Hats,v) elseif v:IsA("Shirt") then Clothes.Shirt=v elseif v:IsA("Pants") then Clothes.Pants=v end end)
  128. Hats.RemoveAll=function()
  129. for i,v in pairs(Hats) do
  130. Instance.Remove(v)
  131. end
  132. end
  133. Clothes.RemoveAll=function()
  134. for i,v in pairs(Hats) do
  135. Instance.Remove(v)
  136. end
  137. end
  138. --}{ Stopping }{--
  139. for i,v in pairs(char:GetDescendants()) do
  140. if (v.Name=="Animate" and v:IsA("LocalScript")) or v:IsA("Animator") then
  141. Instance.Remove(v)
  142. end
  143. end
  144. --}{ Modules }{--
  145. -- Modules Setup --
  146. --}{ Variables }{--
  147. local Using=false
  148. local Holding=false
  149. local Muted=false
  150. local TimePos=0
  151. local Sine=0
  152. local Change=1
  153. local Pool=0
  154. local WS,JP=50,50
  155. local Step="R"
  156. --}{ Other Values }{--
  157. local necC0,necC1=cf(0,t.Size.Y/2,0),cf(0,-h.Size.Y/2,0)
  158. local rutjC0,rutjC1=cf(0,0,0),cf(0,0,0)
  159. local rsC0,rsC1=cf(t.Size.X/2,t.Size.Y/4,0),cf(-ra.Size.X/2,ra.Size.Y/4,0)
  160. local lsC0,lsC1=cf(-t.Size.X/2,t.Size.Y/4,0),cf(la.Size.X/2,la.Size.Y/4,0)
  161. local rhC0,rhC1=cf(t.Size.X/4,-t.Size.Y/2,0),cf(0,rl.Size.Y/2,0)
  162. local lhC0,lhC1=cf(-t.Size.X/4,-t.Size.Y/2,0),cf(0,ll.Size.Y/2,0)
  163. local StepSounds={
  164. Plastic=2812418291;
  165. SmoothPlastic=2812418291;
  166. Neon=2812418291;
  167. ForceField=2812418291;
  168. Metal=2812417769;
  169. DiamondPlate=2812417769;
  170. CorrodedMetal=2812417769;
  171. Foil=2812417769;
  172. Sand=619188333;
  173. Grass=619188333;
  174. Slate=941640049;
  175. Concrete=941640049;
  176. Granite=941640049;
  177. Pebble=941640049;
  178. Marble=941640049;
  179. Cobblestone=941640049;
  180. Brick=941640049;
  181. Water=685857471;
  182. Wood=2812419402;
  183. WoodPlanks=2812419402;
  184. Fabric=133705377;
  185. Snow=619083295;
  186. }
  187. local ragdollJoints = {
  188. ["R6"] = {
  189. ["Neck"] = {
  190. ["Att0Rotation"] = v3(0,-90,90),
  191. ["Att1Rotation"] = v3(0,-90,90),
  192. ["Position0"] = v3(0,.5,0),
  193. ["Position1"] = v3(0,-.5,0),
  194. ["BallSocketProps"] = {
  195. LimitsEnabled = true,
  196. TwistLimitsEnabled = true,
  197. UpperAngle = 90,
  198. TwistLowerAngle = -90,
  199. TwistUpperAngle = 90
  200. }
  201. },
  202. ["Right Shoulder"] = {
  203. ["Att0Rotation"] = v3(0,0,0),
  204. ["Att1Rotation"] = v3(0,0,-90),
  205. ["Position0"] = v3(.75,.333,0),
  206. ["Position1"] = v3(0,.333,0),
  207. ["BallSocketProps"] = {
  208. LimitsEnabled = true,
  209. TwistLimitsEnabled = true,
  210. UpperAngle = 165,
  211. TwistLowerAngle = -135,
  212. TwistUpperAngle = 135
  213. }
  214. },
  215. ["Left Shoulder"] = {
  216. ["Att0Rotation"] = v3(0,0,0),
  217. ["Att1Rotation"] = v3(0,0,90),
  218. ["Position0"] = v3(-.75,.333,0),
  219. ["Position1"] = v3(0,.333,0),
  220. ["BallSocketProps"] = {
  221. LimitsEnabled = true,
  222. TwistLimitsEnabled = true,
  223. UpperAngle = 165,
  224. TwistLowerAngle = -135,
  225. TwistUpperAngle = 135
  226. }
  227. },
  228. ["Right Hip"] = {
  229. ["Att0Rotation"] = v3(0,-90,-90),
  230. ["Att1Rotation"] = v3(0,-90,-90),
  231. ["Position0"] = v3(.25,-.5,0),
  232. ["Position1"] = v3(0,.5,0),
  233. ["BallSocketProps"] = {
  234. LimitsEnabled = true,
  235. TwistLimitsEnabled = true,
  236. UpperAngle = 100,
  237. TwistLowerAngle = -45,
  238. TwistUpperAngle = 45
  239. }
  240. },
  241. ["Left Hip"] = {
  242. ["Att0Rotation"] = v3(0,-90,-90),
  243. ["Att1Rotation"] = v3(0,-90,-90),
  244. ["Position0"] = v3(-.25,-.5,0),
  245. ["Position1"] = v3(0,.5,0),
  246. ["BallSocketProps"] = {
  247. LimitsEnabled = true,
  248. TwistLimitsEnabled = true,
  249. UpperAngle = 100,
  250. TwistLowerAngle = -45,
  251. TwistUpperAngle = 45
  252. }
  253. }
  254. },
  255. ["R15"] = {
  256. ["Neck"] = {
  257. ["Att0Rotation"] = v3(0,-90,90),
  258. ["Att1Rotation"] = v3(0,-90,90),
  259. ["BallSocketProps"] = {
  260. LimitsEnabled = true,
  261. TwistLimitsEnabled = true,
  262. UpperAngle = 80,
  263. TwistLowerAngle = -75,
  264. TwistUpperAngle = 75
  265. }
  266. },
  267. ["Waist"] = {
  268. ["Att0Rotation"] = v3(0,-90,90),
  269. ["Att1Rotation"] = v3(0,-90,90),
  270. ["BallSocketProps"] = {
  271. LimitsEnabled = true,
  272. TwistLimitsEnabled = true,
  273. UpperAngle = 25,
  274. TwistLowerAngle = -30,
  275. TwistUpperAngle = 30
  276. }
  277. },
  278. ["RightShoulder"] = {
  279. ["Att0Rotation"] = v3(0,0,0),
  280. ["Att1Rotation"] = v3(0,0,-90),
  281. ["BallSocketProps"] = {
  282. LimitsEnabled = true,
  283. TwistLimitsEnabled = true,
  284. UpperAngle = 105,
  285. TwistLowerAngle = -115,
  286. TwistUpperAngle = 115
  287. }
  288. },
  289. ["LeftShoulder"] = {
  290. ["Att0Rotation"] = v3(0,0,0),
  291. ["Att1Rotation"] = v3(0,0,90),
  292. ["BallSocketProps"] = {
  293. LimitsEnabled = true,
  294. TwistLimitsEnabled = true,
  295. UpperAngle = 105,
  296. TwistLowerAngle = -115,
  297. TwistUpperAngle = 115
  298. }
  299. },
  300. ["RightHip"] = {
  301. ["Att0Rotation"] = v3(0,-90,-90),
  302. ["Att1Rotation"] = v3(0,-90,-90),
  303. ["BallSocketProps"] = {
  304. LimitsEnabled = true,
  305. TwistLimitsEnabled = true,
  306. UpperAngle = 80,
  307. TwistLowerAngle = -35,
  308. TwistUpperAngle = 35
  309. }
  310. },
  311. ["LeftHip"] = {
  312. ["Att0Rotation"] = v3(0,-90,-90),
  313. ["Att1Rotation"] = v3(0,-90,-90),
  314. ["BallSocketProps"] = {
  315. LimitsEnabled = true,
  316. TwistLimitsEnabled = true,
  317. UpperAngle = 80,
  318. TwistLowerAngle = -35,
  319. TwistUpperAngle = 35
  320. }
  321. },
  322. ["RightElbow"] = {
  323. ["Att0Rotation"] = v3(0,0,0),
  324. ["Att1Rotation"] = v3(0,0,0),
  325. ["BallSocketProps"] = {
  326. LimitsEnabled = true,
  327. TwistLimitsEnabled = true,
  328. UpperAngle = 0,
  329. TwistLowerAngle = 105,
  330. TwistUpperAngle = 0
  331. }
  332. },
  333. ["LeftElbow"] = {
  334. ["Att0Rotation"] = v3(0,0,0),
  335. ["Att1Rotation"] = v3(0,0,0),
  336. ["BallSocketProps"] = {
  337. LimitsEnabled = true,
  338. TwistLimitsEnabled = true,
  339. UpperAngle = 0,
  340. TwistLowerAngle = 105,
  341. TwistUpperAngle = 0
  342. }
  343. },
  344. ["RightKnee"] = {
  345. ["Att0Rotation"] = v3(0,0,0),
  346. ["Att1Rotation"] = v3(0,0,0),
  347. ["BallSocketProps"] = {
  348. LimitsEnabled = true,
  349. TwistLimitsEnabled = true,
  350. UpperAngle = 0,
  351. TwistLowerAngle = 0,
  352. TwistUpperAngle = -105
  353. }
  354. },
  355. ["LeftKnee"] = {
  356. ["Att0Rotation"] = v3(0,0,0),
  357. ["Att1Rotation"] = v3(0,0,0),
  358. ["BallSocketProps"] = {
  359. LimitsEnabled = true,
  360. TwistLimitsEnabled = true,
  361. UpperAngle = 0,
  362. TwistLowerAngle = 0,
  363. TwistUpperAngle = -105
  364. }
  365. },
  366. ["RightWrist"] = {
  367. ["Att0Rotation"] = v3(0,-90,-90),
  368. ["Att1Rotation"] = v3(0,-90,-90),
  369. ["BallSocketProps"] = {
  370. LimitsEnabled = true,
  371. TwistLimitsEnabled = true,
  372. UpperAngle = 10,
  373. TwistLowerAngle = -35,
  374. TwistUpperAngle = 35
  375. }
  376. },
  377. ["LeftWrist"] = {
  378. ["Att0Rotation"] = v3(0,-90,-90),
  379. ["Att1Rotation"] = v3(0,-90,-90),
  380. ["BallSocketProps"] = {
  381. LimitsEnabled = true,
  382. TwistLimitsEnabled = true,
  383. UpperAngle = 10,
  384. TwistLowerAngle = -35,
  385. TwistUpperAngle = 35
  386. }
  387. },
  388. ["RightAnkle"] = {
  389. ["Att0Rotation"] = v3(0,-90,-90),
  390. ["Att1Rotation"] = v3(0,-90,-90),
  391. ["BallSocketProps"] = {
  392. LimitsEnabled = true,
  393. TwistLimitsEnabled = true,
  394. UpperAngle = 10,
  395. TwistLowerAngle = -35,
  396. TwistUpperAngle = 35
  397. }
  398. },
  399. ["LeftAnkle"] = {
  400. ["Att0Rotation"] = v3(0,-90,-90),
  401. ["Att1Rotation"] = v3(0,-90,-90),
  402. ["BallSocketProps"] = {
  403. LimitsEnabled = true,
  404. TwistLimitsEnabled = true,
  405. UpperAngle = 10,
  406. TwistLowerAngle = -35,
  407. TwistUpperAngle = 35
  408. }
  409. }
  410. }
  411. }
  412. --}{ Creates }{--
  413. ins("ForceField",{Visible=false;Parent=char})
  414. nec=ins("Motor6D",{Name="Neck";Part0=t;Part1=h;C0=necC0;C1=necC1;Parent=t;})
  415. rutj=ins("Motor6D",{Name="RootJoint";Part0=hrp;Part1=t;C0=rutjC0;C1=rutjC1;Parent=hrp;})
  416. rs=ins("Motor6D",{Name="Right Shoulder";Part0=t;Part1=ra;C0=rsC0;C1=rsC1;Parent=t;})
  417. ls=ins("Motor6D",{Name="Left Shoulder";Part0=t;Part1=la;C0=lsC0;C1=lsC1;Parent=t;})
  418. rh=ins("Motor6D",{Name="Right Hip";Part0=t;Part1=rl;C0=rhC0;C1=rhC1;Parent=t;})
  419. lh=ins("Motor6D",{Name="Left Hip";Part0=t;Part1=ll;C0=lhC0;C1=lhC1;Parent=t;})
  420. local Theme=ins("Sound",{SoundId="rbxassetid://1033438052";Volume=1;Pitch=1;Looped=true;Name="Theme";Parent=t;})
  421. Theme:Play()
  422. local Gun=ins("Part",{Size=v3(0,0,0);CanCollide=false;Anchored=false;Massless=false;Locked=true;Name="none of your business";Color=bc("Really black").Color;Parent=ra;})
  423. local Mesh=ins("SpecialMesh",{MeshType="FileMesh";MeshId="rbxassetid://3798133326";Offset=v3(0,0,-.3);Parent=Gun;})
  424. local HandleWeld=ins("Motor6D",{Part0=ra;Part1=Gun;C0=cf(-.2,-.7,-.2)*cf(-90,0,0,true);C1=cf(2.5,-2.5,-1.25,true);Parent=ra;})
  425. local BulletRemote=ins("RemoteEvent",{Name="BulletEvent",Parent=char})
  426. hum.WalkSpeed=WS
  427. --}{ Functions }{--
  428. function kill(who,kill_)
  429. if who and not who:FindFirstChild("urdedxdxdxddxdxdxxddxd") then
  430. if kill_ then
  431. ins("StringValue",{Name = "urdedxdxdxddxdxdxxddxd",Parent = who})
  432. else
  433. ins("StringValue",{Name = "urstunnddxdxdxddxdxdxxddxd",Parent = who})
  434. end
  435. local head
  436. local human = who:FindFirstChildOfClass("Humanoid")
  437. if human then
  438. human.PlatformStand = true
  439. end
  440. if kill_ then
  441. for i,v in pairs(who:GetDescendants()) do
  442. if v.Name == "RagdollHB" then
  443. Instance.Remove(v)
  444. end
  445. end
  446. end
  447. for i,v in pairs(who:GetDescendants()) do
  448. if v:IsA("Motor6D") or v:IsA("Motor6D") then
  449. for _,r in pairs(ragdollJoints) do
  450. for w,j in pairs(r) do
  451. if v.Name == w then
  452. local att0 = ins("Attachment",{Position = v.C0.Position,Orientation = j["Att0Rotation"],Parent = v.Part0})
  453. local att1 = ins("Attachment",{Position = v.C1.Position,Orientation = j["Att1Rotation"],Parent = v.Part1})
  454. if j["Position0"] then
  455. att0.Position = v.Part0.Size * j["Position0"]
  456. end
  457. if j["Position1"] then
  458. att1.Position = v.Part1.Size * j["Position1"]
  459. if not kill_ then
  460. local p = ins("Part",{Name = "RagdollHB",Locked = true,Massless = true,Anchored = false,CanCollide = true,Transparency = 1,Size = v.Part1.Size * v3(.75,.75,.75),Parent = v.Part1})
  461. local w=ins("Motor6D",{Parent=v.Part1;Part0=v.Part1;Part1=p;})
  462. if string.find(v.Part1.Name,"Arm") or string.find(v.Part1.Name,"Leg") then
  463. w.C0 = cf(0,(-v.Part1.Size.Y/2) + p.Size.Y/2,0)
  464. end
  465. end
  466. else
  467. if not kill_ then
  468. local p = ins("Part",{Name = "RagdollHB",Locked = true,Massless = true,Anchored = false,CanCollide = true,Transparency = 1,Size = v.Part1.Size * v3(.5,.3,.5),Parent = v.Part1})
  469. local w=ins("Motor6D",{Parent=v.Part1;Part0=v.Part1;Part1=p;})
  470. elseif v.Part1.Name == "Head" then
  471. local p = ins("Part",{Name = "RagdollHB",Locked = true,Massless = true,Anchored = false,CanCollide = true,Transparency = 1,Size = v.Part1.Size * v3(.5,.3,.5),Parent = v.Part1})
  472. local w=ins("Motor6D",{Parent=v.Part1;Part0=v.Part1;Part1=p;})
  473. end
  474. end
  475. ins("NoCollisionConstraint",{Part0 = v.Part0,Part1 = v.Part1,Parent = v.Part0})
  476. local socket = ins("BallSocketConstraint",{Attachment0 = att0,Attachment1 = att1,Name = w,Parent = att0})
  477. for i,v in pairs(j["BallSocketProps"]) do
  478. socket[i] = v
  479. end
  480. Instance.Remove(v)
  481. end
  482. end
  483. end
  484. elseif v.Name == "HumanoidRootPart" then
  485. Instance.Remove(v)
  486. end
  487. if v:IsA("BasePart") and v.Name ~= "RagdollHB" then
  488. v.Anchored = false
  489. v.TopSurface,v.BottomSurface = 10,10
  490. v.CanCollide = false
  491. if kill_ then
  492. Instance.Remove(v,6.5)
  493. end
  494. if v.Name == "Head" then
  495. head = v
  496. end
  497. elseif v:IsA("Decal") then
  498. if kill_ then
  499. Instance.Remove(v,6.5)
  500. end
  501. end
  502. end
  503. if kill_ then
  504. Instance.Remove(who,10)
  505. end
  506. if human then
  507. if kill_ then
  508. human.BreakJointsOnDeath = false
  509. human.Health = 0
  510. end
  511. human.PlatformStand = true
  512. end
  513. return head
  514. end
  515. end
  516. local function CreateBullet(Pos,Direction,Damage)
  517. local Bullet=ins("Part",{Locked=true;CanCollide=false;Massless=true;Name="Bullet";Transparency=1;CFrame=ORIGCF(Pos.Position,Direction);Size=v3(0,0,0);Parent=Bullets;})
  518. local Att0=ins("Attachment",{Parent=Bullet;Position=v3(0,.5,0)})
  519. local Att1=ins("Attachment",{Parent=Bullet;Position=v3(0,-.5,0)})
  520. local Trail=ins("Trail",{Texture="rbxassetid://3472578683";LightEmission=1;Lifetime=.15;Transparency=NumberSequence.new(0,1);FaceCamera=true;Attachment0=Att0;Attachment1=Att1;Parent=Bullet;})
  521. ins("NumberValue",{Name="Damage";Value=Damage;Parent=Bullet;})
  522. pcall(function()
  523. Bullet:SetNetworkOwner(Player)
  524. end)
  525. Instance.Remove(Bullet,5)
  526. end
  527. function Shoot()
  528. Pool=25
  529. Sound(2757012511,1.5,random(.9,1.1,100),Gun,100,5)
  530. CreateBullet(ra.CFrame*cf(-.2,-1.3,-.35),Mouse.Hit.Position,15)
  531. rs.C1=rsC1*cf(-35,0,0,true)*cf(0,-.1,0)
  532. end
  533. --}{ Connections }{--
  534. Mouse.KeyDown:Connect(function(PLR,Bullet,RHit,RPos,RNID,Direction)
  535. pcall(function()
  536. if PLR~=Player then return end;
  537. local Damage=(Bullet.Damage or Bullet:WaitForChild("Damage",1)).Value
  538. Instance.Remove(Bullet)
  539. Bullet.Parent=nil
  540. local HUM
  541. if (RHit.Parent and RHit.Parent:FindFirstChildOfClass("Humanoid")) or (RHit.Parent.Parent and RHit.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
  542. HUM=RHit.Parent:FindFirstChildOfClass("Humanoid") or RHit.Parent.Parent:FindFirstChildOfClass("Humanoid")
  543. end
  544. local Impact=ins("Part",{Locked=true;Massless=true;CanCollide=false;Name="BulletImpact";Size=v3(.125,.125,0);Material=RHit.Material;Color=bc("Really black").Color;CFrame=ORIGCF(RPos,RPos-RNID)})
  545. if HUM then
  546. Impact.Color=bc("Maroon").Color
  547. if RHit.Name=="Head" then
  548. Damage=Damage*2
  549. end
  550. local Health=HUM.Health
  551. if HUM.MaxHealth>100000000 then
  552. kill(HUM.Parent,true)
  553. ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  554. HUM.Health=0
  555. local S=Sound(3008598428,4,1,RHit,250,7.5)
  556. Instance.Remove(HUM.Parent,S.TimeLength-.175)
  557. coroutine.wrap(function()
  558. wait(S.TimeLength-.175)
  559. ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  560. end)()
  561. end
  562. local Dead=false
  563. if HUM.Health<=(Damage+(1*(HUM.MaxHealth/100))) and HUM.Health>.1 then
  564. kill(HUM.Parent,true)
  565. Dead=true
  566. end
  567. if not Dead then
  568. HUM.Health=HUM.Health-(Damage+(1*(HUM.MaxHealth/100)))
  569. end
  570. coroutine.wrap(function()
  571. wait(1)
  572. if HUM.Health==Health and HUM.Health>.1 then
  573. kill(HUM.Parent,true)
  574. ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  575. HUM.Health=0
  576. local S=Sound(3008598428,4,1,RHit,250,7.5)
  577. Instance.Remove(HUM.Parent,S.TimeLength-.175)
  578. coroutine.wrap(function()
  579. wait(S.TimeLength-.175)
  580. ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  581. end)()
  582. end
  583. end)()
  584. end
  585. local ImpactP2=ins("Part",{Locked=true;Massless=true;CanCollide=false;Transparency=.65;Size=v3(.25,.25,0);Material=RHit.Material;Color=Impact.Color;Parent=Impact})
  586. local M1=ins("SpecialMesh",{MeshType="Brick";Scale=v3(1,1,.3);Parent=Impact})
  587. local M2=ins("SpecialMesh",{MeshType="Brick";Scale=v3(1,1,.2);Parent=ImpactP2})
  588. if RHit.Material==Enum.Material.Metal or RHit.Material==Enum.Material.DiamondPlate or RHit.Material==Enum.Material.CorrodedMetal then
  589. M1.MeshType="Sphere"
  590. M2.MeshType="Sphere"
  591. end
  592. local CF=RHit.CFrame:ToObjectSpace(Impact.CFrame)
  593. local MainWeld=ins("Motor6D",{Part0=RHit;Part1=Impact;C0=CF*cf(0,0,random(-180,180),true);Parent=RHit})
  594. ins("Motor6D",{Part0=Impact;Part1=ImpactP2;C0=cf(0,0,random(-180,180),true);Parent=Impact})
  595. Impact.Parent=MainWeld
  596. Instance.Remove(Impact,5)
  597. Instance.Remove(ins("BodyVelocity",{Parent=RHit,MaxForce=v3(7500,0,7500);Velocity=v3(clamp(Direction.X,-1,1),clamp(Direction.Y,-1,1),clamp(Direction.Z,-1,1))*15}),.1)
  598. end)
  599. end)
  600. Mouse.Button1Down:connect(function(key)
  601. Shoot()
  602. end)
  603. wait(.1)
  604. game:GetService("RunService").Heartbeat:Connect(function()
  605. Pool=clamp(Pool-1,0,25)
  606. if Pool==0 then
  607. Using=false
  608. else
  609. Using=true
  610. end
  611. if Theme.Parent~=t then
  612. Instance.Remove(Theme)
  613. Theme=ins("Sound",{SoundId="rbxassetid://213693358";TimePosition=TimePos;Volume=1;Pitch=.935;Looped=true;Parent=t;})
  614. end
  615. if not Bullets or Bullets.Parent~=char then
  616. Instance.Remove(Bullets)
  617. Bullets=ins("Model",{Name="Bullets";Parent=char;})
  618. end
  619. Theme.Pitch=1
  620. Theme.Name="Theme"
  621. if not Muted then
  622. Theme.Volume=.45
  623. else
  624. Theme.Volume=0
  625. end
  626. Theme.SoundId="rbxassetid://1033438052"
  627. Theme:Resume()
  628. TimePos=Theme.TimePosition
  629. Sine=Sine+Change
  630. local Direction=hum.MoveDirection
  631. if Direction.Magnitude==0 then Direction=hrp.Velocity/7.5 end;
  632. local MoveZ=clamp((Direction*hrp.CFrame.LookVector).X+(Direction*hrp.CFrame.LookVector).Z,-1,1)
  633. local MoveX=clamp((Direction*hrp.CFrame.RightVector).X+(Direction*hrp.CFrame.RightVector).Z,-1,1)
  634. local Moving=(hrp.Velocity*v3(1,0,1)).Magnitude>1
  635. local VerY=hrp.Velocity.Y
  636. local StandR,RPos,RNID=Raycast(t.CFrame*cf(t.Size.X/4,-t.Size.Y/2,0).Position,-hrp.CFrame.UpVector,{char},3,false)
  637. local StandL,LPos,LNID=Raycast(t.CFrame*cf(-t.Size.X/4,-t.Size.Y/2,0).Position,-hrp.CFrame.UpVector,{char},3,false)
  638. local CF=cf()
  639. pcall(function()
  640. CF=(hrp.CFrame*cf(0,t.Size.Y/2+h.Size.Y/2,0)):ToObjectSpace(ORIGCF((hrp.CFrame*cf(0,t.Size.Y/2+h.Size.Y/2,0)).Position,Mouse.Hit.Position))
  641. end)
  642. hum.JumpPower=JP
  643. if not Moving and (StandR or StandL) then
  644. local IdleVal=20
  645. Change=1
  646. nec.C0=nec.C0:Lerp(necC0*(CF-CF.Position)*cf(0,0,0)*cf(-sin(Sine/IdleVal)*3,CosSin(Sine/(IdleVal*2.5))*5,0,true)*cf(0,0,0)*cf(0,-30,0,true),.2)
  647. rutj.C0=rutj.C0:Lerp(rutjC0*cf(0,.05*cos(Sine/IdleVal),0)*cf(CosSin(Sine/IdleVal)*3,sin(Sine/(IdleVal*4))*5,0,true)*cf(0,0,0)*cf(0,30,0,true),.2)
  648. if not Using then
  649. rs.C0=rs.C0:Lerp(rsC0*cf(0,-.05*cos(Sine/IdleVal),0)*cf(sin(Sine/IdleVal)*5,0,0,true)*cf(-.3,-.65,.15)*cf(130,20,-10,true),.2)
  650. else
  651. rs.C0=rs.C0:Lerp(rsC0*(CF-CF.Position)*cf(0,-30,0,true)*cf(90,0,0,true),.65)
  652. end
  653. ls.C0=ls.C0:Lerp(lsC0*cf(0,-.05*cos(Sine/IdleVal),0)*cf(-sin(Sine/IdleVal)*3,0,CosSin(Sine/(IdleVal*2))*5,true)*cf(.1,-.05,0)*cf(0,-2.5,4,true),.2)
  654. rh.C0=rh.C0:Lerp(rhC0*cf(0,-30,0,true)*cf(0,-.05*cos(Sine/IdleVal),0)*cf((-CosSin(Sine/IdleVal)*4.5)-(sin(Sine/(IdleVal*4))*3.5),0,0,true)*cf(0,0,-.2)*cf(-5,0,2.5,true),.2)
  655. lh.C0=lh.C0:Lerp(lhC0*cf(0,-30,0,true)*cf(0,-.05*cos(Sine/IdleVal),0)*cf((-CosSin(Sine/IdleVal)*4.5)+(sin(Sine/(IdleVal*4))*3.5),0,0,true)*cf(0,0,0)*cf(0,35,-3,true),.2)
  656. elseif Moving and (StandR or StandL) then
  657. local WSVal=6/clamp(hum.WalkSpeed/16,.25,2)*t.Size.Y/2
  658. local WSMul=(1+(WSVal/4))
  659. Change=.875
  660. nec.C0=nec.C0:Lerp(necC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,0,0)*cf(sin(Sine/(WSVal/2))*7.5,-sin(Sine/WSVal)*15,0,true)*angles(MoveZ/12,-MoveX/1.5,0)*(CF-CF.Position),.2/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  661. rutj.C0=rutj.C0:Lerp(rutjC0*cf(0,0,0)*cf(0,0,0,true)*cf(-.5*(t.Size.Y/2)*sin(Sine/(WSVal/2))/(1+(WSVal/4))*MoveX,1.5*(t.Size.Y/2)*cos(Sine/(WSVal/2))/(1+(WSVal/4)),-.5*(t.Size.Y/2)*sin(Sine/(WSVal/2))/(1+(WSVal/4))*MoveZ)*cf(cos(Sine/(WSVal/2))*7.5*MoveZ,math.CosSin(Sine/WSVal)*20,cos(Sine/(WSVal/2))*7.5*MoveX,true)*angles((-MoveZ/7.5)*math.clamp((hum.WalkSpeed/16)/(t.Size.Y/2),.5,3.5),0,-MoveX/5),.2/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  662. if not Using then
  663. rs.C0=rs.C0:Lerp(rsC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,0,.75*(t.Size.Y/2)*sin(Sine/WSVal)/(1+(WSVal/4))*math.abs(MoveZ))*cf(7.5-sin(Sine/WSVal)*200/(1+(WSVal/4))*MoveZ,-sin(Sine/WSVal)*30,-15*MoveZ,true),.2/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  664. else
  665. rs.C0=rs.C0:Lerp(rsC0*(CF-CF.Position)*cf(90,0,0,true),.65)
  666. end
  667. ls.C0=ls.C0:Lerp(lsC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,0,-.75*(t.Size.Y/2)*sin(Sine/WSVal)/(1+(WSVal/4))*math.abs(MoveZ))*cf(7.5+sin(Sine/WSVal)*200/(1+(WSVal/4))*MoveZ,-sin(Sine/WSVal)*30,15*MoveZ,true),.2/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  668. rh.C0=rh.C0:Lerp(rhC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,.5*(t.Size.Y/2)*cos(Sine/WSVal),(.1-.8)*(t.Size.Y/2)*cos(Sine/WSVal))*cf(-5+math.clamp((sin(Sine/WSVal)*200/(1+(WSVal/4)))*MoveZ,-130,130),cos(Sine/WSVal)*5,(sin(Sine/WSVal)*60)*MoveX,true),.2/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  669. lh.C0=lh.C0:Lerp(lhC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,-.5*(t.Size.Y/2)*cos(Sine/WSVal),(.1+.8)*(t.Size.Y/2)*cos(Sine/WSVal))*cf(-5-math.clamp((sin(Sine/WSVal)*200/(1+(WSVal/4)))*MoveZ,-130,130),cos(Sine/WSVal)*5,-(sin(Sine/WSVal)*60)*MoveX,true),.2/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  670. --thanks to kyu or neb.. whatever
  671. if cos(Sine/WSVal)/2>.2 and Step=="L" then
  672. Step="R"
  673. if StandR then
  674. local SoundId=StepSounds[StandR.Material.Name] or 0
  675. if StandR.Material=="Sand" and (StandR.Color.r>.7 and StandR.Color.g>.7 and StandR.Color.b>.7) then
  676. SoundId=StepSounds["Snow"]
  677. end
  678. local SizeVal=StandR.Size*RNID
  679. if SoundId==941640049 then
  680. SizeVal=SizeVal/2
  681. end
  682. Sound(SoundId,(.35*clamp((hum.WalkSpeed/16)/1.5,.5,3.5))/clamp(math.max(SizeVal.X,SizeVal.Y,SizeVal.Z),.5,1.25),random(.9,1.1,100)*clamp(math.max(SizeVal.X,SizeVal.Y,SizeVal.Z)/10,.5,1.2)*clamp((hum.WalkSpeed/16)/1.5,.5,2),t)
  683. end
  684. end
  685. if cos(Sine/WSVal)/2<-.2 and Step=="R" then
  686. Step="L"
  687. if StandL then
  688. local SoundId=StepSounds[StandL.Material.Name] or 0
  689. if StandL.Material==Enum.Material.Sand and (StandL.Color.r>.7 and StandL.Color.g>.7 and StandL.Color.b>.7) then
  690. SoundId=StepSounds["Snow"]
  691. end
  692. local SizeVal=StandL.Size*LNID
  693. if SoundId==941640049 then
  694. SizeVal=SizeVal/2
  695. end
  696. Sound(SoundId,(.35*clamp((hum.WalkSpeed/16)/1.5,.5,3.5))/clamp(math.max(SizeVal.X,SizeVal.Y,SizeVal.Z),.5,1.25),random(.9,1.1,100)*clamp(math.max(SizeVal.X,SizeVal.Y,SizeVal.Z)/2,.5,1.2)*clamp((hum.WalkSpeed/16)/1.5,.5,2),t)
  697. end
  698. end
  699. elseif not(StandR and StandL) then
  700. Change=1
  701. nec.C0=nec.C0:Lerp(necC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,0,0)*cf(clamp(hrp.Velocity.Y,-15,15),0,0,true)*(CF-CF.Position),.2)
  702. rutj.C0=rutj.C0:Lerp(rutjC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,0,0)*cf(clamp(hrp.Velocity.Y,-30,20),0,0,true),.2)
  703. if not Using then
  704. rs.C0=rs.C0:Lerp(rsC0*cf(0,0,0)*cf(0,5,-7.5,true)*cf(-(clamp(hrp.Velocity.Y/20,-.45,0)),0,0)*cf((clamp(hrp.Velocity.Y*4,0,150)),0,-(clamp(hrp.Velocity.Y*4,-120,0)),true),.2)
  705. else
  706. rs.C0=rs.C0:Lerp(rsC0*(CF-CF.Position)*cf(90,0,0,true),.65)
  707. end
  708. ls.C0=ls.C0:Lerp(lsC0*cf(0,0,0)*cf(0,-5,7.5,true)*cf((clamp(hrp.Velocity.Y/20,-.45,0)),0,0)*cf((clamp(hrp.Velocity.Y*4,0,150)),0,(clamp(hrp.Velocity.Y*4,-120,0)),true),.2)
  709. rh.C0=rh.C0:Lerp(rhC0*cf(0,0,0)*cf(0,0,0,true)*cf(0,.4,-.35)*cf(-10,-5,5,true),.2)
  710. lh.C0=lh.C0:Lerp(lhC0*cf(0,0,0)*cf(clamp(-hrp.Velocity.Y,-25,35),0,0,true)*cf(0,.2,-.15)*cf(-2.5,5,-5,true),.2)
  711. end
  712. nec.C1=nec.C1:Lerp(necC1,.2)
  713. rutj.C1=rutj.C1:Lerp(rutjC1,.2)
  714. rs.C1=rs.C1:Lerp(rsC1,.2)
  715. ls.C1=ls.C1:Lerp(lsC1,.2)
  716. rh.C1=rh.C1:Lerp(rhC1,.2)
  717. lh.C1=lh.C1:Lerp(lhC1,.2)
  718. necC0,necC1=cf(0,t.Size.Y/2,0),cf(0,-h.Size.Y/2,0)
  719. rutjC0,rutjC1=cf(0,0,0),cf(0,0,0)
  720. rsC0,rsC1=cf(t.Size.X/2,t.Size.Y/4,0),cf(-ra.Size.X/2,ra.Size.Y/4,0)
  721. lsC0,lsC1=cf(-t.Size.X/2,t.Size.Y/4,0),cf(la.Size.X/2,la.Size.Y/4,0)
  722. rhC0,rhC1=cf(t.Size.X/4,-t.Size.Y/2,0),cf(0,rl.Size.Y/2,0)
  723. lhC0,lhC1=cf(-t.Size.X/4,-t.Size.Y/2,0),cf(0,ll.Size.Y/2,0)
  724. end)
  725. --}{ Loops }{--
  726.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement