vL4d_4eVer

CrazeRunner

Nov 11th, 2019 (edited)
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 34.95 KB | None | 0 0
  1. local Client=NLS([[
  2.     local ORIGCF=CFrame.new
  3.     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;})
  4.     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;})
  5.     local Instance=setmetatable({new = function(type,args) local instance = Instance.new(type) 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 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;})
  6.     local HeadCameraFollowing=true
  7.     local Player=game:GetService("Players").LocalPlayer
  8.     local Mouse=Player:GetMouse()
  9.     local UIS=game:GetService("UserInputService")
  10.     local Remote=script:WaitForChild("Control",2).Value
  11.     local ins=Instance.new
  12.     local v3=Vector3.new
  13.     local cf=CFrame.new
  14.     local ud2=UDim2.new
  15.     local angles=CFrame.Angles
  16.     local random=math.random
  17.     local clamp=math.clamp
  18.     local ray=Ray.new
  19.     local huge=math.huge
  20.     local char=Player.Character
  21.     local hum=char:FindFirstChildOfClass("Humanoid")
  22.     local t=char.Torso
  23.     local hrp=char.HumanoidRootPart
  24.     local Bullets=char:WaitForChild("Bullets",5)
  25.     local BulletEvent=char:WaitForChild("BulletEvent",5)
  26.     local HoldingSpace=false
  27.     local CanJump=true
  28.     local JumpPool=0
  29.     function Raycast(Origin,Direction,Blacklist,MaxDistance,IgnoreWater)
  30.     local a1=workspace:FindPartOnRayWithIgnoreList(ray(Origin,Direction.Unit*MaxDistance),Blacklist or {},false,IgnoreWater)
  31.     if a1 and typeof(a1)~="Vector3" then
  32.         return workspace:FindPartOnRayWithIgnoreList(ray(Origin,Direction.Unit*MaxDistance),Blacklist or {},false,IgnoreWater)
  33.     else
  34.         return nil
  35.     end
  36. end
  37.     function Tween(Object,Args,Info)
  38.         if Object and Args then
  39.             Info = Info or TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
  40.             if typeof(Info) == "table" then Info = TweenInfo.new(unpack(Info)) end
  41.             game:GetService("TweenService"):Create(Object,Info,Args):Play()
  42.         end
  43.     end
  44.     function Sound(Id,Volume,Pitch,Parent,MaxDistance,EmitterSize,Looped)
  45.         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})
  46.         S:Play()
  47.         coroutine.wrap(function()
  48.             if S.Looped then return end
  49.             if S.IsLoaded then
  50.                 Instance.Remove(S,S.TimeLength/S.Pitch)
  51.             else
  52.                 S.Loaded:Connect(function()
  53.                     Instance.Remove(S,S.TimeLength/S.Pitch)
  54.                 end)
  55.             end
  56.         end)()
  57.         return S
  58.     end
  59.     local function Jump()
  60.         if not CanJump then return end;
  61.         JumpPool=12
  62.         local Stand=Raycast(hrp.CFrame*cf(0,-hrp.Size.Y/2,0).Position,-hrp.CFrame.UpVector,{char},3.5,true)
  63.         if not Stand then return end;
  64.         local Mul=1
  65.         local Hit,HitPos=Raycast(hrp.Position,hrp.Velocity/10,{char},5,true)
  66.         if Hit then Mul=.125 end;
  67.         Instance.Remove(ins("BodyVelocity",{MaxForce=v3(50000,50000,50000);Velocity=(((hrp.Velocity/10)+v3(.025,.025,.025))*v3(Mul,.7,Mul)+v3(0,1,0))*35;Parent=hrp;}),.1)
  68.         wait(.1)
  69.         Instance.Remove(ins("BodyPosition",{MaxForce=v3(35000,0,35000);Position=hrp.Position+hrp.Velocity/5;Parent=hrp;}),.1)
  70.     end
  71.     UIS.InputBegan:Connect(function(IO,Locked)
  72.         Remote:FireServer("UIS+Mouse",{Hit=Mouse.Hit;Target=Mouse.Target;X=Mouse.X;Y=Mouse.Y;},{IO={UserInputType=IO.UserInputType;KeyCode=IO.KeyCode;};Locked=Locked;InputState="Began"})
  73.         if Locked then return end;
  74.         if IO.KeyCode==Enum.KeyCode.Space then
  75.             HoldingSpace=true
  76.             repeat
  77.                 Jump()
  78.                 wait(1/30)
  79.             until not HoldingSpace
  80.         end
  81.     end)
  82.     UIS.InputEnded:Connect(function(IO,Locked)
  83.         Remote:FireServer("UIS+Mouse",{Hit=Mouse.Hit;Target=Mouse.Target;X=Mouse.X;Y=Mouse.Y;},{IO={UserInputType=IO.UserInputType;KeyCode=IO.KeyCode;};Locked=Locked;InputState="Ended"})
  84.         if IO.KeyCode==Enum.KeyCode.Space then
  85.             HoldingSpace=false
  86.         end
  87.     end)
  88.     local Head=Player.Character.Head
  89.     local HRP=Player.Character.HumanoidRootPart
  90.     local Hum=Player.Character:FindFirstChildOfClass("Humanoid")
  91.     local function ShowCross(Pos,Parent)
  92.         local Holder=ins("Part",{Size=v3(0,0,0);Anchored=true;CanCollide=false;Transparency=1;CFrame=Pos;Parent=Parent;})
  93.         local BUI=ins("BillboardGui",{Size=ud2(0,125,0,125);Adornee=Holder;AlwaysOnTop=true;Parent=Holder;})
  94.         local Cross=ins("ImageLabel",{BackgroundTransparency=1;Size=ud2(1,0,1,0);Image="rbxassetid://253263084";Rotation=45;Parent=BUI})
  95.         Instance.Remove(Holder,.35)
  96.         Tween(Cross,{ImageTransparency=1},{.25,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,.1})
  97.         Sound(179235828,1,random(.9,1.1,100),Player.PlayerGui,1,1)
  98.     end
  99.     local function Connect(Model)
  100.         Model.ChildAdded:Connect(function(Child)
  101.             if Child.Name=="Bullet" then
  102.                 local Ignore={char}
  103.                 local RHit,RPos,RNID=Raycast(Child.Position,Child.CFrame.LookVector,Ignore,75,true)
  104.                 if RHit then
  105.                     Child.Name="DeadBullet"
  106.                     Child.Anchored=true
  107.                     BulletEvent:FireServer(Child,RHit,RPos,RNID,Child.CFrame.LookVector)
  108.                     if (RHit.Parent and RHit.Parent:FindFirstChildOfClass("Humanoid")) or (RHit.Parent.Parent and RHit.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
  109.                         ShowCross(ORIGCF(RPos),workspace)
  110.                     end
  111.                 end
  112.                 ins("BodyVelocity",{Parent=Child;MaxForce=v3(500000,500000,500000);Velocity=Child.CFrame.LookVector*1650})
  113.             end
  114.         end)
  115.     end
  116.     Connect(Bullets)
  117.     char.ChildAdded:Connect(function(Child)
  118.         if Child.Name=="Bullets" then
  119.             Bullets=Child
  120.             Connect(Bullets)
  121.         end
  122.     end)
  123.     game:GetService("RunService").Heartbeat:Connect(function()
  124.         JumpPool=math.clamp(JumpPool-1,0,60)
  125.         if JumpPool<=0 then
  126.             CanJump=true
  127.         else
  128.             CanJump=false
  129.         end
  130.         if HeadCameraFollowing then
  131.             local CF=Head.CFrame:ToObjectSpace(HRP.CFrame*CFrame.new(0,1.5,0))
  132.             Hum.CameraOffset=Hum.CameraOffset:Lerp(-CF.Position,.15)
  133.         else
  134.             Hum.CameraOffset=Hum.CameraOffset:Lerp(Vector3.new(0,0,0),.15)
  135.         end
  136.         local Table=Bullets:GetChildren()
  137.         local Ignore={char}
  138.         for i=1,#Table do
  139.             local v=Table[i]
  140.             if v.Name=="Bullet" then
  141.                 local RHit,RPos,RNID=Raycast(v.Position,v.Velocity,Ignore,75,true)
  142.                 if RHit then
  143.                     v.Name="DeadBullet"
  144.                     v.Anchored=true
  145.                     BulletEvent:FireServer(v,RHit,RPos,RNID,v.Velocity)
  146.                     if (RHit.Parent and RHit.Parent:FindFirstChildOfClass("Humanoid")) or (RHit.Parent.Parent and RHit.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
  147.                         ShowCross(ORIGCF(RPos),workspace)
  148.                     end
  149.                 end
  150.             end
  151.         end
  152.         local Point = HRP.CFrame:VectorToObjectSpace(Mouse.Hit.Position-HRP.Position)
  153.         if not hum.Sit then
  154.             if Point.Z>0 then
  155.                 if Point.X>0 then
  156.                     HRP.CFrame=ORIGCF(HRP.Position,v3(Mouse.Hit.X,HRP.Position.Y,Mouse.Hit.Z))*cf(0,89.9,0,true)
  157.                 elseif Point.X<0 then
  158.                     HRP.CFrame=ORIGCF(HRP.Position,v3(Mouse.Hit.X,HRP.Position.Y,Mouse.Hit.Z))*cf(0,-89.9,0,true)
  159.                 end
  160.             end
  161.         end
  162.         Remote:FireServer("Mouse",{Hit=Mouse.Hit;Target=Mouse.Target;X=Mouse.X;Y=Mouse.Y;})
  163.     end)
  164. ]],owner.Character)
  165. local ORIGCF=CFrame.new
  166. 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;})
  167. 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;})
  168. 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;})
  169. local Player,UIS,Mouse;
  170. do
  171.     Player=owner
  172.     Mouse={}
  173.     UIS={}
  174.     local Remote=Instance.new("RemoteEvent",{Name="ok";Parent=Player.Character})
  175.     local MouseR=Instance.new("BindableEvent")
  176.     local UISR=Instance.new("BindableEvent")
  177.     UIS.Input=UISR.Event
  178.     Remote.OnServerEvent:Connect(function(plr,InputType,MouseArgs,UISArgs)
  179.         pcall(function()
  180.             if Player~=plr then return end;
  181.             if InputType=="Mouse" then
  182.                 Mouse.Hit=MouseArgs.Hit
  183.                 Mouse.Target=MouseArgs.Target
  184.                 Mouse.X=MouseArgs.X
  185.                 Mouse.Y=MouseArgs.Y
  186.             elseif InputType=="UIS" then
  187.                 UISR:Fire(UISArgs.IO,UISArgs.Locked,UISArgs.InputState)
  188.             elseif InputType=="UIS+Mouse" then
  189.                 Mouse.Hit=MouseArgs.Hit
  190.                 Mouse.Target=MouseArgs.Target
  191.                 Mouse.X=MouseArgs.X
  192.                 Mouse.Y=MouseArgs.Y
  193.                 UISR:Fire(UISArgs.IO,UISArgs.Locked,UISArgs.InputState)
  194.             end
  195.         end)
  196.     end);
  197.     Instance.new("ObjectValue",{Name="Control";Parent=Client;Value=Remote;})
  198. end;
  199. --}{        Default Functions      }{--
  200. local ins=Instance.new
  201. local v3=Vector3.new
  202. local v2=Vector2.new
  203. local cf=CFrame.new
  204. local angles=CFrame.Angles
  205. local ud=UDim.new
  206. local ud2=UDim2.new
  207. local c3=Color3.new
  208. local rgb=Color3.fromRGB
  209. local hsv=Color3.fromHSV
  210. local bc=BrickColor.new
  211. local bcRandom=BrickColor.Random
  212. local palette=BrickColor.palatte
  213. local cs=ColorSequence.new
  214. local ns=NumberSequence.new
  215. local nsk=NumberSequenceKeypoint.new
  216. local nr=NumberRange.new
  217. local random=math.random
  218. local rad=math.rad
  219. local sin=math.sin
  220. local cos=math.cos
  221. local tan=math.tan
  222. local CosSin=math.CosSin
  223. local floor=math.floor
  224. local pi=math.floor
  225. local abs=math.abs
  226. local sqrt=math.sqrt
  227. local clamp=math.clamp
  228. local ray=Ray.new
  229. local huge=math.huge
  230. --}{        Useful Functions       }{--
  231. function Tween(Object,Args,Info)
  232.     if Object and Args then
  233.         Info = Info or TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
  234.         if typeof(Info) == "table" then Info = TweenInfo.new(unpack(Info)) end
  235.         game:GetService("TweenService"):Create(Object,Info,Args):Play()
  236.     end
  237. end
  238. function Sound(Id,Volume,Pitch,Parent,MaxDistance,EmitterSize,Looped)
  239.     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})
  240.     S:Play()
  241.     coroutine.wrap(function()
  242.         if S.Looped then return end
  243.         if S.IsLoaded then
  244.             Instance.Remove(S,S.TimeLength/S.Pitch)
  245.         else
  246.             S.Loaded:Connect(function()
  247.                 Instance.Remove(S,S.TimeLength/S.Pitch)
  248.             end)
  249.         end
  250.     end)()
  251.     return S
  252. end
  253. function Raycast(Origin,Direction,Blacklist,MaxDistance,IgnoreWater)
  254.     local a1=workspace:FindPartOnRayWithIgnoreList(ray(Origin,Direction.Unit*MaxDistance),Blacklist or {},false,IgnoreWater)
  255.     if a1 and typeof(a1)~="Vector3" then
  256.         return workspace:FindPartOnRayWithIgnoreList(ray(Origin,Direction.Unit*MaxDistance),Blacklist or {},false,IgnoreWater)
  257.     else
  258.         return nil
  259.     end
  260. end
  261. --}{            Character          }{--
  262. local char=Player.Character
  263. local hum=char:FindFirstChildOfClass("Humanoid")
  264. local h=char.Head
  265. local t=char.Torso
  266. local hrp=char.HumanoidRootPart
  267. local ra=char["Right Arm"]
  268. local la=char["Left Arm"]
  269. local rl=char["Right Leg"]
  270. local ll=char["Left Leg"]
  271. local nec=t.Neck
  272. local rutj=hrp.RootJoint
  273. local rs=t["Right Shoulder"]
  274. local ls=t["Left Shoulder"]
  275. local rh=t["Right Hip"]
  276. local lh=t["Left Hip"]
  277. local Bullets=ins("Model",{Name="Bullets";Parent=char;})
  278. --}{        Character Funtions      }{--
  279. local Hats={}
  280. local Clothes={}
  281. 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)
  282. Hats.RemoveAll=function()
  283.     for i,v in pairs(Hats) do
  284.         Instance.Remove(v)
  285.     end
  286. end
  287. Clothes.RemoveAll=function()
  288.     for i,v in pairs(Hats) do
  289.         Instance.Remove(v)
  290.     end
  291. end
  292. --}{            Stopping       }{--
  293. for i,v in pairs(char:GetDescendants()) do
  294.     if (v.Name=="Animate" and v:IsA("LocalScript")) or v:IsA("Animator") then
  295.         Instance.Remove(v)
  296.     end
  297. end
  298. --}{            Modules        }{--
  299. --           Modules Setup            --
  300. --}{            Variables          }{--
  301. local Using=false
  302. local Holding=false
  303. local Muted=false
  304. local TimePos=0
  305. local Sine=0
  306. local Change=1
  307. local Pool=0
  308. local WS,JP=50,50
  309. local Step="R"
  310. --}{            Other Values       }{--
  311. local necC0,necC1=cf(0,t.Size.Y/2,0),cf(0,-h.Size.Y/2,0)
  312. local rutjC0,rutjC1=cf(0,0,0),cf(0,0,0)
  313. local rsC0,rsC1=cf(t.Size.X/2,t.Size.Y/4,0),cf(-ra.Size.X/2,ra.Size.Y/4,0)
  314. local lsC0,lsC1=cf(-t.Size.X/2,t.Size.Y/4,0),cf(la.Size.X/2,la.Size.Y/4,0)
  315. local rhC0,rhC1=cf(t.Size.X/4,-t.Size.Y/2,0),cf(0,rl.Size.Y/2,0)
  316. local lhC0,lhC1=cf(-t.Size.X/4,-t.Size.Y/2,0),cf(0,ll.Size.Y/2,0)
  317. local StepSounds={
  318.     Plastic=2812418291;
  319.     SmoothPlastic=2812418291;
  320.     Neon=2812418291;
  321.     ForceField=2812418291;
  322.     Metal=2812417769;
  323.     DiamondPlate=2812417769;
  324.     CorrodedMetal=2812417769;
  325.     Foil=2812417769;
  326.     Sand=619188333;
  327.     Grass=619188333;
  328.     Slate=941640049;
  329.     Concrete=941640049;
  330.     Granite=941640049;
  331.     Pebble=941640049;
  332.     Marble=941640049;
  333.     Cobblestone=941640049;
  334.     Brick=941640049;
  335.     Water=685857471;
  336.     Wood=2812419402;
  337.     WoodPlanks=2812419402;
  338.     Fabric=133705377;
  339.     Snow=619083295;
  340. }
  341. local ragdollJoints = {
  342.     ["R6"] = {
  343.         ["Neck"] = {
  344.             ["Att0Rotation"] = v3(0,-90,90),
  345.             ["Att1Rotation"] = v3(0,-90,90),
  346.             ["Position0"] = v3(0,.5,0),
  347.             ["Position1"] = v3(0,-.5,0),
  348.             ["BallSocketProps"] = {
  349.                 LimitsEnabled = true,
  350.                 TwistLimitsEnabled = true,
  351.                 UpperAngle = 90,
  352.                 TwistLowerAngle = -90,
  353.                 TwistUpperAngle = 90
  354.             }
  355.         },
  356.         ["Right Shoulder"] = {
  357.             ["Att0Rotation"] = v3(0,0,0),
  358.             ["Att1Rotation"] = v3(0,0,-90),
  359.             ["Position0"] = v3(.75,.333,0),
  360.             ["Position1"] = v3(0,.333,0),
  361.             ["BallSocketProps"] = {
  362.                 LimitsEnabled = true,
  363.                 TwistLimitsEnabled = true,
  364.                 UpperAngle = 165,
  365.                 TwistLowerAngle = -135,
  366.                 TwistUpperAngle = 135
  367.             }
  368.         },
  369.         ["Left Shoulder"] = {
  370.             ["Att0Rotation"] = v3(0,0,0),
  371.             ["Att1Rotation"] = v3(0,0,90),
  372.             ["Position0"] = v3(-.75,.333,0),
  373.             ["Position1"] = v3(0,.333,0),
  374.             ["BallSocketProps"] = {
  375.                 LimitsEnabled = true,
  376.                 TwistLimitsEnabled = true,
  377.                 UpperAngle = 165,
  378.                 TwistLowerAngle = -135,
  379.                 TwistUpperAngle = 135
  380.             }
  381.         },
  382.         ["Right Hip"] = {
  383.             ["Att0Rotation"] = v3(0,-90,-90),
  384.             ["Att1Rotation"] = v3(0,-90,-90),
  385.             ["Position0"] = v3(.25,-.5,0),
  386.             ["Position1"] = v3(0,.5,0),
  387.             ["BallSocketProps"] = {
  388.                 LimitsEnabled = true,
  389.                 TwistLimitsEnabled = true,
  390.                 UpperAngle = 100,
  391.                 TwistLowerAngle = -45,
  392.                 TwistUpperAngle = 45
  393.             }
  394.         },
  395.         ["Left Hip"] = {
  396.             ["Att0Rotation"] = v3(0,-90,-90),
  397.             ["Att1Rotation"] = v3(0,-90,-90),
  398.             ["Position0"] = v3(-.25,-.5,0),
  399.             ["Position1"] = v3(0,.5,0),
  400.             ["BallSocketProps"] = {
  401.                 LimitsEnabled = true,
  402.                 TwistLimitsEnabled = true,
  403.                 UpperAngle = 100,
  404.                 TwistLowerAngle = -45,
  405.                 TwistUpperAngle = 45
  406.             }
  407.         }
  408.     },
  409.     ["R15"] = {
  410.         ["Neck"] = {
  411.             ["Att0Rotation"] = v3(0,-90,90),
  412.             ["Att1Rotation"] = v3(0,-90,90),
  413.             ["BallSocketProps"] = {
  414.                 LimitsEnabled = true,
  415.                 TwistLimitsEnabled = true,
  416.                 UpperAngle = 80,
  417.                 TwistLowerAngle = -75,
  418.                 TwistUpperAngle = 75
  419.             }
  420.         },
  421.         ["Waist"] = {
  422.             ["Att0Rotation"] = v3(0,-90,90),
  423.             ["Att1Rotation"] = v3(0,-90,90),
  424.             ["BallSocketProps"] = {
  425.                 LimitsEnabled = true,
  426.                 TwistLimitsEnabled = true,
  427.                 UpperAngle = 25,
  428.                 TwistLowerAngle = -30,
  429.                 TwistUpperAngle = 30
  430.             }
  431.         },
  432.         ["RightShoulder"] = {
  433.             ["Att0Rotation"] = v3(0,0,0),
  434.             ["Att1Rotation"] = v3(0,0,-90),
  435.             ["BallSocketProps"] = {
  436.                 LimitsEnabled = true,
  437.                 TwistLimitsEnabled = true,
  438.                 UpperAngle = 105,
  439.                 TwistLowerAngle = -115,
  440.                 TwistUpperAngle = 115
  441.             }
  442.         },
  443.         ["LeftShoulder"] = {
  444.             ["Att0Rotation"] = v3(0,0,0),
  445.             ["Att1Rotation"] = v3(0,0,90),
  446.             ["BallSocketProps"] = {
  447.                 LimitsEnabled = true,
  448.                 TwistLimitsEnabled = true,
  449.                 UpperAngle = 105,
  450.                 TwistLowerAngle = -115,
  451.                 TwistUpperAngle = 115
  452.             }
  453.         },
  454.         ["RightHip"] = {
  455.             ["Att0Rotation"] = v3(0,-90,-90),
  456.             ["Att1Rotation"] = v3(0,-90,-90),
  457.             ["BallSocketProps"] = {
  458.                 LimitsEnabled = true,
  459.                 TwistLimitsEnabled = true,
  460.                 UpperAngle = 80,
  461.                 TwistLowerAngle = -35,
  462.                 TwistUpperAngle = 35
  463.             }
  464.         },
  465.         ["LeftHip"] = {
  466.             ["Att0Rotation"] = v3(0,-90,-90),
  467.             ["Att1Rotation"] = v3(0,-90,-90),
  468.             ["BallSocketProps"] = {
  469.                 LimitsEnabled = true,
  470.                 TwistLimitsEnabled = true,
  471.                 UpperAngle = 80,
  472.                 TwistLowerAngle = -35,
  473.                 TwistUpperAngle = 35
  474.             }
  475.         },
  476.         ["RightElbow"] = {
  477.             ["Att0Rotation"] = v3(0,0,0),
  478.             ["Att1Rotation"] = v3(0,0,0),
  479.             ["BallSocketProps"] = {
  480.                 LimitsEnabled = true,
  481.                 TwistLimitsEnabled = true,
  482.                 UpperAngle = 0,
  483.                 TwistLowerAngle = 105,
  484.                 TwistUpperAngle = 0
  485.             }
  486.         },
  487.         ["LeftElbow"] = {
  488.             ["Att0Rotation"] = v3(0,0,0),
  489.             ["Att1Rotation"] = v3(0,0,0),
  490.             ["BallSocketProps"] = {
  491.                 LimitsEnabled = true,
  492.                 TwistLimitsEnabled = true,
  493.                 UpperAngle = 0,
  494.                 TwistLowerAngle = 105,
  495.                 TwistUpperAngle = 0
  496.             }
  497.         },
  498.         ["RightKnee"] = {
  499.             ["Att0Rotation"] = v3(0,0,0),
  500.             ["Att1Rotation"] = v3(0,0,0),
  501.             ["BallSocketProps"] = {
  502.                 LimitsEnabled = true,
  503.                 TwistLimitsEnabled = true,
  504.                 UpperAngle = 0,
  505.                 TwistLowerAngle = 0,
  506.                 TwistUpperAngle = -105
  507.             }
  508.         },
  509.         ["LeftKnee"] = {
  510.             ["Att0Rotation"] = v3(0,0,0),
  511.             ["Att1Rotation"] = v3(0,0,0),
  512.             ["BallSocketProps"] = {
  513.                 LimitsEnabled = true,
  514.                 TwistLimitsEnabled = true,
  515.                 UpperAngle = 0,
  516.                 TwistLowerAngle = 0,
  517.                 TwistUpperAngle = -105
  518.             }
  519.         },
  520.         ["RightWrist"] = {
  521.             ["Att0Rotation"] = v3(0,-90,-90),
  522.             ["Att1Rotation"] = v3(0,-90,-90),
  523.             ["BallSocketProps"] = {
  524.                 LimitsEnabled = true,
  525.                 TwistLimitsEnabled = true,
  526.                 UpperAngle = 10,
  527.                 TwistLowerAngle = -35,
  528.                 TwistUpperAngle = 35
  529.             }
  530.         },
  531.         ["LeftWrist"] = {
  532.             ["Att0Rotation"] = v3(0,-90,-90),
  533.             ["Att1Rotation"] = v3(0,-90,-90),
  534.             ["BallSocketProps"] = {
  535.                 LimitsEnabled = true,
  536.                 TwistLimitsEnabled = true,
  537.                 UpperAngle = 10,
  538.                 TwistLowerAngle = -35,
  539.                 TwistUpperAngle = 35
  540.             }
  541.         },
  542.         ["RightAnkle"] = {
  543.             ["Att0Rotation"] = v3(0,-90,-90),
  544.             ["Att1Rotation"] = v3(0,-90,-90),
  545.             ["BallSocketProps"] = {
  546.                 LimitsEnabled = true,
  547.                 TwistLimitsEnabled = true,
  548.                 UpperAngle = 10,
  549.                 TwistLowerAngle = -35,
  550.                 TwistUpperAngle = 35
  551.             }
  552.         },
  553.         ["LeftAnkle"] = {
  554.             ["Att0Rotation"] = v3(0,-90,-90),
  555.             ["Att1Rotation"] = v3(0,-90,-90),
  556.             ["BallSocketProps"] = {
  557.                 LimitsEnabled = true,
  558.                 TwistLimitsEnabled = true,
  559.                 UpperAngle = 10,
  560.                 TwistLowerAngle = -35,
  561.                 TwistUpperAngle = 35
  562.             }
  563.         }
  564.     }
  565. }
  566. --}{            Creates            }{--
  567. Instance.Remove({nec;rutj;rs;ls;rh;lh})
  568. ins("ForceField",{Visible=false;Parent=char})
  569. nec=ins("Motor6D",{Name="Neck";Part0=t;Part1=h;C0=necC0;C1=necC1;Parent=t;})
  570. rutj=ins("Motor6D",{Name="RootJoint";Part0=hrp;Part1=t;C0=rutjC0;C1=rutjC1;Parent=hrp;})
  571. rs=ins("Motor6D",{Name="Right Shoulder";Part0=t;Part1=ra;C0=rsC0;C1=rsC1;Parent=t;})
  572. ls=ins("Motor6D",{Name="Left Shoulder";Part0=t;Part1=la;C0=lsC0;C1=lsC1;Parent=t;})
  573. rh=ins("Motor6D",{Name="Right Hip";Part0=t;Part1=rl;C0=rhC0;C1=rhC1;Parent=t;})
  574. lh=ins("Motor6D",{Name="Left Hip";Part0=t;Part1=ll;C0=lhC0;C1=lhC1;Parent=t;})
  575. local Theme=ins("Sound",{SoundId="rbxassetid://1033438052";Volume=1;Pitch=1;Looped=true;Name="Theme";Parent=t;})
  576. Theme:Play()
  577. 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;})
  578. local Mesh=ins("SpecialMesh",{MeshType="FileMesh";MeshId="rbxassetid://3798133326";Offset=v3(0,0,-.3);Parent=Gun;})
  579. local HandleWeld=ins("Weld",{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;})
  580. local BulletRemote=ins("RemoteEvent",{Name="BulletEvent",Parent=char})
  581. hum.WalkSpeed=WS
  582. --}{            Functions          }{--
  583. function kill(who,kill_)
  584.     if who and not who:FindFirstChild("urdedxdxdxddxdxdxxddxd") then
  585.         if kill_ then
  586.             ins("StringValue",{Name = "urdedxdxdxddxdxdxxddxd",Parent = who})
  587.         else
  588.             ins("StringValue",{Name = "urstunnddxdxdxddxdxdxxddxd",Parent = who})
  589.         end
  590.         local head
  591.         local human = who:FindFirstChildOfClass("Humanoid")
  592.         if human then
  593.             human.PlatformStand = true
  594.         end
  595.         if kill_ then
  596.             for i,v in pairs(who:GetDescendants()) do
  597.                 if v.Name == "RagdollHB" then
  598.                     Instance.Remove(v)
  599.                 end
  600.             end
  601.         end
  602.         for i,v in pairs(who:GetDescendants()) do
  603.             if v:IsA("Motor6D") or v:IsA("Weld") then
  604.                 for _,r in pairs(ragdollJoints) do
  605.                     for w,j in pairs(r) do
  606.                         if v.Name == w then
  607.                             local att0 = ins("Attachment",{Position = v.C0.Position,Orientation = j["Att0Rotation"],Parent = v.Part0})
  608.                             local att1 = ins("Attachment",{Position = v.C1.Position,Orientation = j["Att1Rotation"],Parent = v.Part1})
  609.                             if j["Position0"] then
  610.                                 att0.Position = v.Part0.Size * j["Position0"]
  611.                             end
  612.                             if j["Position1"] then
  613.                                 att1.Position = v.Part1.Size * j["Position1"]
  614.                                 if not kill_ then
  615.                                     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})
  616.                                     local w=ins("Weld",{Parent=v.Part1;Part0=v.Part1;Part1=p;})
  617.                                     if string.find(v.Part1.Name,"Arm") or string.find(v.Part1.Name,"Leg") then
  618.                                         w.C0 = cf(0,(-v.Part1.Size.Y/2) + p.Size.Y/2,0)
  619.                                     end
  620.                                 end
  621.                             else
  622.                                 if not kill_ then
  623.                                     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})
  624.                                     local w=ins("Weld",{Parent=v.Part1;Part0=v.Part1;Part1=p;})
  625.                                 elseif v.Part1.Name == "Head" then
  626.                                     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})
  627.                                     local w=ins("Weld",{Parent=v.Part1;Part0=v.Part1;Part1=p;})
  628.                                 end
  629.                             end
  630.                             ins("NoCollisionConstraint",{Part0 = v.Part0,Part1 = v.Part1,Parent = v.Part0})
  631.                             local socket = ins("BallSocketConstraint",{Attachment0 = att0,Attachment1 = att1,Name = w,Parent = att0})
  632.                             for i,v in pairs(j["BallSocketProps"]) do
  633.                                 socket[i] = v
  634.                             end
  635.                             Instance.Remove(v)
  636.                         end
  637.                     end
  638.                 end
  639.             elseif v.Name == "HumanoidRootPart" then
  640.                 Instance.Remove(v)
  641.             end
  642.             if v:IsA("BasePart") and v.Name ~= "RagdollHB" then
  643.                 v.Anchored = false
  644.                 v.TopSurface,v.BottomSurface = 10,10
  645.                 v.CanCollide = false
  646.                 if kill_ then
  647.                     Instance.Remove(v,6.5)
  648.                 end
  649.                 if v.Name == "Head" then
  650.                     head = v
  651.                 end
  652.             elseif v:IsA("Decal") then
  653.                 if kill_ then
  654.                     Instance.Remove(v,6.5)
  655.                 end
  656.             end
  657.         end
  658.         if kill_ then
  659.             Instance.Remove(who,10)
  660.         end
  661.         if human then
  662.             if kill_ then
  663.                 human.BreakJointsOnDeath = false
  664.                 human.Health = 0
  665.             end
  666.             human.PlatformStand = true
  667.         end
  668.         return head
  669.     end
  670. end
  671. local function CreateBullet(Pos,Direction,Damage)
  672.     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;})
  673.     local Att0=ins("Attachment",{Parent=Bullet;Position=v3(0,.5,0)})
  674.     local Att1=ins("Attachment",{Parent=Bullet;Position=v3(0,-.5,0)})
  675.     local Trail=ins("Trail",{Texture="rbxassetid://3472578683";LightEmission=1;Lifetime=.15;Transparency=NumberSequence.new(0,1);FaceCamera=true;Attachment0=Att0;Attachment1=Att1;Parent=Bullet;})
  676.     ins("NumberValue",{Name="Damage";Value=Damage;Parent=Bullet;})
  677.     pcall(function()
  678.         Bullet:SetNetworkOwner(Player)
  679.     end)
  680.     Instance.Remove(Bullet,5)
  681. end
  682. function Shoot()
  683.     Pool=25
  684.     Sound(2757012511,1.5,random(.9,1.1,100),Gun,100,5)
  685.     CreateBullet(ra.CFrame*cf(-.2,-1.3,-.35),Mouse.Hit.Position,15)
  686.     rs.C1=rsC1*cf(-35,0,0,true)*cf(0,-.1,0)
  687. end
  688. --}{            Connections        }{--
  689. BulletRemote.OnServerEvent:Connect(function(PLR,Bullet,RHit,RPos,RNID,Direction)
  690.     pcall(function()
  691.         if PLR~=Player then return end;
  692.         local Damage=(Bullet.Damage or Bullet:WaitForChild("Damage",1)).Value
  693.         Instance.Remove(Bullet)
  694.         Bullet.Parent=nil
  695.         local HUM
  696.         if (RHit.Parent and RHit.Parent:FindFirstChildOfClass("Humanoid")) or (RHit.Parent.Parent and RHit.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
  697.             HUM=RHit.Parent:FindFirstChildOfClass("Humanoid") or RHit.Parent.Parent:FindFirstChildOfClass("Humanoid")
  698.         end
  699.         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)})
  700.         if HUM then
  701.             Impact.Color=bc("Maroon").Color
  702.             if RHit.Name=="Head" then
  703.                 Damage=Damage*2
  704.             end
  705.             local Health=HUM.Health
  706.             if HUM.MaxHealth>100000000 then
  707.                 kill(HUM.Parent,true)
  708.                 ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  709.                 HUM.Health=0
  710.                 local S=Sound(3008598428,4,1,RHit,250,7.5)
  711.                 Instance.Remove(HUM.Parent,S.TimeLength-.175)
  712.                 coroutine.wrap(function()
  713.                     wait(S.TimeLength-.175)
  714.                     ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  715.                 end)()
  716.             end
  717.             local Dead=false
  718.             if HUM.Health<=(Damage+(1*(HUM.MaxHealth/100))) and HUM.Health>.1 then
  719.                 kill(HUM.Parent,true)
  720.                 Dead=true
  721.             end
  722.             if not Dead then
  723.                 HUM.Health=HUM.Health-(Damage+(1*(HUM.MaxHealth/100)))
  724.             end
  725.             coroutine.wrap(function()
  726.                 wait(1)
  727.                 if HUM.Health==Health and HUM.Health>.1 then
  728.                     kill(HUM.Parent,true)
  729.                     ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  730.                     HUM.Health=0
  731.                     local S=Sound(3008598428,4,1,RHit,250,7.5)
  732.                     Instance.Remove(HUM.Parent,S.TimeLength-.175)
  733.                     coroutine.wrap(function()
  734.                         wait(S.TimeLength-.175)
  735.                         ins("Explosion",{Parent=workspace;Position=RHit.Position;BlastRadius=0})
  736.                     end)()
  737.                 end
  738.             end)()
  739.         end
  740.         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})
  741.         local M1=ins("SpecialMesh",{MeshType="Brick";Scale=v3(1,1,.3);Parent=Impact})
  742.         local M2=ins("SpecialMesh",{MeshType="Brick";Scale=v3(1,1,.2);Parent=ImpactP2})
  743.         if RHit.Material==Enum.Material.Metal or RHit.Material==Enum.Material.DiamondPlate or RHit.Material==Enum.Material.CorrodedMetal then
  744.             M1.MeshType="Sphere"
  745.             M2.MeshType="Sphere"
  746.         end
  747.         local CF=RHit.CFrame:ToObjectSpace(Impact.CFrame)
  748.         local MainWeld=ins("Weld",{Part0=RHit;Part1=Impact;C0=CF*cf(0,0,random(-180,180),true);Parent=RHit})
  749.         ins("Weld",{Part0=Impact;Part1=ImpactP2;C0=cf(0,0,random(-180,180),true);Parent=Impact})
  750.         Impact.Parent=MainWeld
  751.         Instance.Remove(Impact,5)
  752.         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)
  753.     end)
  754. end)
  755. UIS.Input:Connect(function(IO,Locked,InputState)
  756.     if Locked then return end;
  757.     if IO.UserInputType==Enum.UserInputType.Keyboard then
  758.         if InputState=="Began" then
  759.             if IO.KeyCode==Enum.KeyCode.M then
  760.                 Muted=not Muted
  761.             end
  762.         elseif InputState=="Ended" then
  763.            
  764.         end
  765.     elseif IO.UserInputType==Enum.UserInputType.MouseButton1 then
  766.         if InputState=="Began" then
  767.             Shoot()
  768.             Holding=true
  769.         elseif InputState=="Ended" then
  770.             Holding=false
  771.         end
  772.     end
  773. end)
  774. coroutine.wrap(function()
  775.     while wait(1/5) do
  776.         if Holding then
  777.             Shoot()
  778.         end
  779.     end
  780. end)()
  781. wait(.1)
  782. game:GetService("RunService").Heartbeat:Connect(function()
  783.     Pool=clamp(Pool-1,0,25)
  784.     if Pool==0 then
  785.         Using=false
  786.     else
  787.         Using=true
  788.     end
  789.     if Theme.Parent~=t then
  790.         Instance.Remove(Theme)
  791.         Theme=ins("Sound",{SoundId="rbxassetid://213693358";TimePosition=TimePos;Volume=1;Pitch=.935;Looped=true;Parent=t;})
  792.     end
  793.     if not Bullets or Bullets.Parent~=char then
  794.         Instance.Remove(Bullets)
  795.         Bullets=ins("Model",{Name="Bullets";Parent=char;})
  796.     end
  797.     Theme.Pitch=1
  798.     Theme.Name="Theme"
  799.     if not Muted then
  800.         Theme.Volume=.45
  801.     else
  802.         Theme.Volume=0
  803.     end
  804.     Theme.SoundId="rbxassetid://1033438052"
  805.     Theme:Resume()
  806.     TimePos=Theme.TimePosition
  807.     Sine=Sine+Change
  808.     local Direction=hum.MoveDirection
  809.     if Direction.Magnitude==0 then Direction=hrp.Velocity/7.5 end;
  810.     local MoveZ=clamp((Direction*hrp.CFrame.LookVector).X+(Direction*hrp.CFrame.LookVector).Z,-1,1)
  811.     local MoveX=clamp((Direction*hrp.CFrame.RightVector).X+(Direction*hrp.CFrame.RightVector).Z,-1,1)
  812.     local Moving=(hrp.Velocity*v3(1,0,1)).Magnitude>1
  813.     local VerY=hrp.Velocity.Y
  814.     local StandR,RPos,RNID=Raycast(t.CFrame*cf(t.Size.X/4,-t.Size.Y/2,0).Position,-hrp.CFrame.UpVector,{char},3,false)
  815.     local StandL,LPos,LNID=Raycast(t.CFrame*cf(-t.Size.X/4,-t.Size.Y/2,0).Position,-hrp.CFrame.UpVector,{char},3,false)
  816.     local CF=cf()
  817.     pcall(function()
  818.         CF=(hrp.CFrame*cf(0,t.Size.Y/2+h.Size.Y/2,0)):ToObjectSpace(cf((hrp.CFrame*cf(0,t.Size.Y/2+h.Size.Y/2,0)).Position,Mouse.Hit.Position))
  819.     end)
  820.     hum.JumpPower=JP
  821.     if not Moving and (StandR or StandL) then
  822.         local IdleVal=20
  823.         Change=1
  824.         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)
  825.         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)
  826.         if not Using then
  827.             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)
  828.         else
  829.             rs.C0=rs.C0:Lerp(rsC0*(CF-CF.Position)*cf(0,-30,0,true)*cf(90,0,0,true),.65)
  830.         end
  831.         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)
  832.         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)
  833.         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)
  834.     elseif Moving and (StandR or StandL) then
  835.         local WSVal=6/clamp(hum.WalkSpeed/16,.25,2)*t.Size.Y/2
  836.         local WSMul=(1+(WSVal/4))
  837.         Change=.875
  838.         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)
  839.         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)
  840.         if not Using then
  841.             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)
  842.         else
  843.             rs.C0=rs.C0:Lerp(rsC0*(CF-CF.Position)*cf(90,0,0,true),.65)
  844.         end
  845.         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)
  846.         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)
  847.         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)
  848.         --thanks to kyu or neb.. whatever
  849.         if cos(Sine/WSVal)/2>.2 and Step=="L" then
  850.             Step="R"
  851.             if StandR then
  852.                 local SoundId=StepSounds[StandR.Material.Name] or 0
  853.                 if StandR.Material=="Sand" and (StandR.Color.r>.7 and StandR.Color.g>.7 and StandR.Color.b>.7) then
  854.                     SoundId=StepSounds["Snow"]
  855.                 end
  856.                 local SizeVal=StandR.Size*RNID
  857.                 if SoundId==941640049 then
  858.                     SizeVal=SizeVal/2
  859.                 end
  860.                 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)
  861.             end
  862.         end
  863.         if cos(Sine/WSVal)/2<-.2 and Step=="R" then
  864.             Step="L"
  865.             if StandL then
  866.                 local SoundId=StepSounds[StandL.Material.Name] or 0
  867.                 if StandL.Material==Enum.Material.Sand and (StandL.Color.r>.7 and StandL.Color.g>.7 and StandL.Color.b>.7) then
  868.                     SoundId=StepSounds["Snow"]
  869.                 end
  870.                 local SizeVal=StandL.Size*LNID
  871.                 if SoundId==941640049 then
  872.                     SizeVal=SizeVal/2
  873.                 end
  874.                 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)
  875.             end
  876.         end
  877.     elseif not(StandR and StandL) then
  878.         Change=1
  879.         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)
  880.         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)
  881.         if not Using then
  882.             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)
  883.         else
  884.             rs.C0=rs.C0:Lerp(rsC0*(CF-CF.Position)*cf(90,0,0,true),.65)
  885.         end
  886.         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)
  887.         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)
  888.         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)
  889.     end
  890.     nec.C1=nec.C1:Lerp(necC1,.2)
  891.     rutj.C1=rutj.C1:Lerp(rutjC1,.2)
  892.     rs.C1=rs.C1:Lerp(rsC1,.2)
  893.     ls.C1=ls.C1:Lerp(lsC1,.2)
  894.     rh.C1=rh.C1:Lerp(rhC1,.2)
  895.     lh.C1=lh.C1:Lerp(lhC1,.2)
  896.     necC0,necC1=cf(0,t.Size.Y/2,0),cf(0,-h.Size.Y/2,0)
  897.     rutjC0,rutjC1=cf(0,0,0),cf(0,0,0)
  898.     rsC0,rsC1=cf(t.Size.X/2,t.Size.Y/4,0),cf(-ra.Size.X/2,ra.Size.Y/4,0)
  899.     lsC0,lsC1=cf(-t.Size.X/2,t.Size.Y/4,0),cf(la.Size.X/2,la.Size.Y/4,0)
  900.     rhC0,rhC1=cf(t.Size.X/4,-t.Size.Y/2,0),cf(0,rl.Size.Y/2,0)
  901.     lhC0,lhC1=cf(-t.Size.X/4,-t.Size.Y/2,0),cf(0,ll.Size.Y/2,0)
  902. end)
  903. --}{            Loops          }{--
Add Comment
Please, Sign In to add comment