vL4d_4eVer

Rockter

Dec 31st, 2020 (edited)
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 30.13 KB | None | 0 0
  1. script.Parent=owner.PlayerGui
  2. local Client=NLS([==[
  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({Angles=function(Arg1,Arg2,Arg3,Angles) if not Angles then return CFrame.Angles(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 ray=Ray.new
  7. local Player,UIS,Mouse=game:GetService("Players").LocalPlayer,game:GetService("UserInputService")
  8. local Mouse=Player:GetMouse()
  9. local Rem=script:WaitForChild("Input")
  10. local InfoRef=Rem.InfoRef
  11. local Values=script
  12. local HeadFollow=(Values.HeadFollow or{Value=false}).Value
  13. local Resetted=false
  14. local Char=Player.Character
  15. local H=Char.Head
  16. local Hum=Char:FindFirstChildOfClass("Humanoid")
  17. local HRP=Char.HumanoidRootPart
  18. local Effects=Char:WaitForChild("Effects")
  19. local Rocks={}
  20. local CSFuncs={Events={},Functions={}}
  21. function Raycast(Origin,Direction,Blacklist,MaxDistance,IgnoreWater)
  22.     local Par=RaycastParams.new() Par.FilterType=Enum.RaycastFilterType.Blacklist Par.FilterDescendantsInstances=Blacklist Par.IgnoreWater=IgnoreWater
  23.     local Res=workspace:Raycast(Origin,Direction.Unit*MaxDistance,Par)
  24.     if Res then
  25.         return Res.Instance,Res.Position,Res.Normal,Res.Material
  26.     else
  27.         return nil,Vector3.new(),Vector3.new(),Enum.Material.Air
  28.     end
  29. end
  30. function CreateCSFunc(Type,Name,Func)
  31.     if CSFuncs[Type.."s"] then
  32.         CSFuncs[Type.."s"][Name]=Func
  33.         return Func
  34.     end
  35. end
  36. function CSFire(self,AT,Name,...)
  37.         if not self then return end
  38.     if AT=="S" then
  39.         return Rem:FireServer({},false,AT,Name,...)
  40.     elseif AT=="R" then
  41.         return InfoRef:InvokeServer(AT,Name,...)
  42.     end
  43. end
  44. function CSTrig(self,Type,Name,...)
  45.     if not self then return end
  46.     if CSFuncs[Type.."s"] and CSFuncs[Type.."s"][Name] then
  47.         return CSFuncs[Type.."s"][Name](...)
  48.     end
  49. end
  50. CSFuncs.new=CreateCSFunc
  51. CSFuncs.Fire=CSFire
  52. CSFuncs.Trigger=CSTrig
  53. --// Free space for CrossServer functions \\
  54. local TurnToggled=false
  55. CSFuncs.new("Event","ToggleTTM",function(Bool)
  56.     TurnToggled=Bool
  57. end)
  58. UIS.InputBegan:Connect(function(IO,L) Rem:FireServer({Mouse=false,UserInputState=IO.UserInputState,KeyCode=IO.KeyCode,UserInputType=IO.UserInputType},L) end)
  59. UIS.InputEnded:Connect(function(IO,L) Rem:FireServer({Mouse=false,UserInputState=IO.UserInputState,KeyCode=IO.KeyCode,UserInputType=IO.UserInputType},L) end)
  60. game:GetService("RunService").Heartbeat:Connect(function()
  61.     HeadFollow=(Values.HeadFollow or{Value=false}).Value
  62.     if HeadFollow then
  63.         Resetted=false
  64.         local CF=H.CFrame:ToObjectSpace(HRP.CFrame*CFrame.new(0,1.5,0))
  65.         Hum.CameraOffset=Hum.CameraOffset:Lerp(-CF.Position,.125)
  66.     elseif not HeadFollow and not Resetted then
  67.         Resetted=true
  68.         Hum.CameraOffset=Vector3.new
  69.     end
  70.     if TurnToggled then
  71.         HRP.CFrame=CFrame.new(HRP.Position,Vector3.new(Mouse.Hit.X,HRP.Position.Y,Mouse.Hit.Z))
  72.     end
  73.     if #Rocks>0 then
  74.         for i,v in pairs(Rocks) do
  75.             if not v[1].Parent then Rocks[i]=nil end
  76.             v[2].CFrame=CFrame.new(v[1].Position,v[1].Position+v[1].Velocity)
  77.             local Hit,Pos,NID,Mat=Raycast(v[1].Position,v[1].Velocity,{Char},v[1].Velocity.Magnitude/6,true)
  78.             if Mat then
  79.                 v[1].Parent=nil
  80.                 CSFuncs:Fire("S","Impact",{Hit,Pos})
  81.                 Rocks[i]=nil
  82.             end
  83.         end
  84.     end
  85. end)
  86. Effects.ChildAdded:Connect(function(C)
  87.     if C.Name=="GODDAMNROCK" then
  88.         Instance.Remove(Instance.new("BodyVelocity",{MaxForce=Vector3.new(math.huge,math.huge,math.huge),Velocity=C.CFrame.LookVector*350,Parent=C}),.2)
  89.         local Gyr=Instance.new("BodyGyro",{D=250,P=5000,MaxTorque=Vector3.new(math.huge,math.huge,math.huge),CFrame=CFrame.new(C.Position,C.Position+C.Velocity),Parent=C})
  90.         local Hit,Pos,NID,Mat=Raycast(C.Position,C.CFrame.LookVector,{Char},5,true)
  91.         if Mat then
  92.             C.Parent=nil
  93.             CSFuncs:Fire("S","Impact",{Hit,Pos})
  94.             return
  95.         end
  96.         table.insert(Rocks,{C,Gyr})
  97.     end
  98. end)
  99. Rem.OnClientEvent:Connect(function(Name,...)
  100.     return CSFuncs:Trigger("Event",Name,...)
  101. end)
  102. InfoRef.OnClientInvoke=function(Name,...)
  103.     return CSFuncs:Trigger("Function",Name,...)
  104. end
  105. while wait(1/30) do
  106.     Rem:FireServer({Mouse=true,Hit=Mouse.Hit,Target=Mouse.Target,Origin=Mouse.Origin})
  107. end
  108. ]==],script)  Client.Disabled=true
  109. Client.Name="SClient"
  110. 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,})
  111. local CFrame=setmetatable({Angles=function(Arg1,Arg2,Arg3,Angles) if not Angles then return CFrame.Angles(Arg1,Arg2,Arg3) else return CFrame.Angles(math.rad(Arg1),math.rad(Arg2),math.rad(Arg3)) end end,},{__index=CFrame,})
  112. 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,})
  113. local Player,UIS,Mouse,CrossClient=owner,nil,nil,nil
  114. do 
  115.     Instance.new("RemoteFunction",{Name="InfoRef",Parent=Instance.new("RemoteEvent",{Name="Input",Parent=Client})})
  116.     Instance.new("BoolValue",{Name="HeadFollow",Value=true,Parent=Client})
  117.     local Rem=Client:WaitForChild("Input",5)
  118.     local InfoRef=Rem:WaitForChild("InfoRef",5)
  119.     local function NewEv(MultipleFuncs)
  120.         local Table={FE=true}
  121.         if MultipleFuncs then
  122.             Table.Funcs={}
  123.         end
  124.         Table.Connect=function(self,Name,Func) -- t:Connect(nil,...) nil - skip indexing and keep it as a rewritable function
  125.             local T={}
  126.             local TableFuncs=Name~=nil
  127.             if not TableFuncs then
  128.                 self.Function=Func
  129.             else
  130.                 self.Funcs[Name]=Func
  131.             end
  132.             T.Disconnect=function(self)
  133.                 if not TableFuncs then
  134.                     self.Function=nil
  135.                 else
  136.                     self.Funcs[Name]=nil
  137.                 end
  138.             end
  139.             T.disconnect=T.Disconnect
  140.             return T
  141.         end
  142.         Table.connect=Table.Connect
  143.         return Table
  144.     end
  145.     CrossClient={Events=NewEv(true),Functions=NewEv(true)}
  146.     UIS={InputBegan=NewEv(),InputEnded=NewEv()}
  147.     Mouse={Hit=CFrame.new(),Target=CFrame.new(),Origin=CFrame.new()}
  148.     local function FireEUIS(self,Name,...)
  149.         local F=UIS[Name]
  150.         if F and F.FE then
  151.             if F.Function then
  152.                 F.Function(...)
  153.             elseif F.Funcs then
  154.                 for i,v in pairs(F.Funcs) do
  155.                     v(...)
  156.                 end
  157.             end
  158.         end
  159.     end
  160.     CrossClient.AddFunction=function(self,Type,Name,Function)
  161.         if not self then return end
  162.         if type(Name)=="function" then Function=Name Name=nil end
  163.         assert(CrossClient[Type.."s"],"unsupported event type")
  164.         if Name then
  165.             CrossClient[Type.."s"][Name]=Function
  166.         else
  167.             table.insert(CrossClient[Type.."s"],Function)
  168.         end
  169.     end
  170.     CrossClient.RemoveFunction=function(self,Type,Name)
  171.         if not self then return end
  172.         assert(CrossClient[Type.."s"],"unsupported event type")
  173.         assert(Name,"no event name given")
  174.         CrossClient[Type.."s"][Name]=nil
  175.     end
  176.     CrossClient.RemoveFunction=function(self,Type,Name)
  177.         if not self then return end
  178.         assert(CrossClient[Type.."s"],"unsupported event type")
  179.         assert(Name,"no event name given")
  180.         CrossClient[Type.."s"][Name]=nil
  181.     end
  182.     CrossClient.FireClient=function(self,Type,Name,...)
  183.         if not self then return end
  184.         assert(CrossClient[Type.."s"],"unsupported event type")
  185.         assert(Name,"no event name given")
  186.         if Type=="Event" then
  187.             return Rem:FireClient(Player,Name,...)
  188.         elseif Type=="Function" then
  189.             return InfoRef:InvokeClient(Player,Name,...)
  190.         end
  191.     end
  192.     UIS.FireEv=FireEUIS
  193.     InfoRef.OnServerInvoke=function(PLR,...)
  194.         if PLR~=Player then return end
  195.         local Args={...}
  196.         if Args[1]=="R" then
  197.             return CrossClient.Functions[Args[2]](Args[3])
  198.         end
  199.     end
  200.     Rem.OnServerEvent:Connect(function(PLR,IO,L,...)
  201.         if PLR~=Player then return end
  202.         local Args={...}
  203.         local Ret=false
  204.         if #Args>0 then
  205.             if Args[1]=="S" then
  206.             Ret=true
  207.                 return CrossClient.Events[Args[2]](Args[3])
  208.             end
  209.         end
  210.         if Ret then return end
  211.         if IO.Mouse then
  212.             Mouse.Hit=IO.Hit
  213.             Mouse.Target=IO.Target
  214.             Mouse.Origin=IO.Origin
  215.         else
  216.             if IO.UserInputState==Enum.UserInputState.Begin then
  217.                 UIS:FireEv("InputBegan",IO,L)
  218.             else
  219.                 UIS:FireEv("InputEnded",IO,L)
  220.             end
  221.         end
  222.     end)
  223.     Client.Disabled=false
  224. end
  225. --// Shortcuts
  226. local ins=Instance.new
  227. local v3=Vector3.new
  228. local v2=Vector2.new
  229. local cf=CFrame.new
  230. local angles=CFrame.Angles
  231. local ud=UDim.new
  232. local ud2=UDim2.new
  233. local c3=Color3.new
  234. local rgb=Color3.fromRGB
  235. local hsv=Color3.fromHSV
  236. local bc=BrickColor.new
  237. local bcRandom=BrickColor.Random
  238. local palette=BrickColor.palette
  239. local cs=ColorSequence.new
  240. local ns=NumberSequence.new
  241. local nsk=NumberSequenceKeypoint.new
  242. local nr=NumberRange.new
  243. local random=math.random
  244. local rad=math.rad
  245. local sin=math.sin
  246. local cos=math.cos
  247. local tan=math.tan
  248. local cotan=math.CosSin
  249. local floor=math.floor
  250. local pi=math.floor
  251. local abs=math.abs
  252. local sqrt=math.sqrt
  253. local clamp=math.clamp
  254. local ray=Ray.new
  255. local huge=math.huge
  256. --// Basic functions
  257. function Tween(Object,Args,Info)
  258.     if Object and Args then
  259.         Info = Info or TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
  260.         if typeof(Info) == "table" then Info = TweenInfo.new(unpack(Info)) end
  261.         game:GetService("TweenService"):Create(Object,Info,Args):Play()
  262.     end
  263. end
  264. function Sound(Id,Volume,Pitch,Parent,MaxDistance,EmitterSize,Looped)
  265.     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})
  266.     S:Play()
  267.     coroutine.wrap(function()
  268.         if S.Looped then return end
  269.         if S.IsLoaded then
  270.             Instance.Remove(S,S.TimeLength/S.Pitch)
  271.         else
  272.             S.Loaded:Connect(function()
  273.                 Instance.Remove(S,S.TimeLength/S.Pitch)
  274.             end)
  275.         end
  276.     end)()
  277.     return S
  278. end
  279. function Raycast(Origin,Direction,Blacklist,MaxDistance,IgnoreWater)
  280.     return workspace:FindPartOnRayWithIgnoreList(ray(Origin,Direction.Unit*MaxDistance),Blacklist or {},false,IgnoreWater)
  281. end
  282. --// Setup 1
  283. for i,v in pairs(Player.Character:GetDescendants()) do
  284.     if (v.Name=="Animate" and v:IsA("LocalScript")) or v:IsA("Animator") then
  285.         Instance.Remove(v)
  286.     end
  287. end
  288. --// Character indexing
  289. local LockWS,LockJP=false,false
  290. local Type="R6"
  291. local Char,char=Player.Character,Player.Character
  292. local Hum,hum=Char:FindFirstChildOfClass("Humanoid"),Char:FindFirstChildOfClass("Humanoid")
  293. local hrp,HRP=Char.HumanoidRootPart,Char.HumanoidRootPart
  294. local h,t,ra,la,rl,ll
  295. local nec,rs,ls,rh,lh,rutj
  296. local necC0,necC1=cf(),cf()
  297. local rutjC0,rutjC1=cf(),cf()
  298. local rsC0,rsC1=cf(),cf()
  299. local lsC0,lsC1=cf(),cf()
  300. local rhC0,rhC1=cf(),cf()
  301. local lhC0,lhC1=cf(),cf()
  302. local h,ut,lt,rua,rla,rh,lua,lla,lh,rul,rll,rf,lul,lll,lf
  303. local CFs={}
  304. local Joints={}
  305. if Type=="R6" then
  306.     h,t,ra,la,rl,ll=char.Head,char.Torso,char["Right Arm"],char["Left Arm"],char["Right Leg"],char["Left Leg"]
  307.     nec,rutj,rs,ls,rh,lh=t.Neck,hrp.RootJoint,t["Right Shoulder"],t["Left Shoulder"],t["Right Hip"],t["Left Hip"]
  308.     necC0,necC1=cf(0,t.Size.Y/2,0),cf(0,-h.Size.Y/2,0)
  309.     rutjC0,rutjC1=cf(0,0,0),cf(0,0,0)
  310.     rsC0,rsC1=cf(t.Size.X/2,t.Size.Y/4,0),cf(-ra.Size.X/2,ra.Size.Y/4,0)
  311.     lsC0,lsC1=cf(-t.Size.X/2,t.Size.Y/4,0),cf(la.Size.X/2,la.Size.Y/4,0)
  312.     rhC0,rhC1=cf(t.Size.X/4,-t.Size.Y/2,0),cf(0,rl.Size.Y/2,0)
  313.     lhC0,lhC1=cf(-t.Size.X/4,-t.Size.Y/2,0),cf(0,ll.Size.Y/2,0)
  314.     Instance.Remove({nec,rutj,rs,ls,rh,lh})
  315.     nec=ins("Motor6D",{Name="Neck",Part0=t,Part1=h,C0=necC0,C1=necC1,Parent=t,})
  316.     rutj=ins("Motor6D",{Name="RootJoint",Part0=hrp,Part1=t,C0=rutjC0,C1=rutjC1,Parent=hrp,})
  317.     rs=ins("Motor6D",{Name="Right Shoulder",Part0=t,Part1=ra,C0=rsC0,C1=rsC1,Parent=t,})
  318.     ls=ins("Motor6D",{Name="Left Shoulder",Part0=t,Part1=la,C0=lsC0,C1=lsC1,Parent=t,})
  319.     rh=ins("Motor6D",{Name="Right Hip",Part0=t,Part1=rl,C0=rhC0,C1=rhC1,Parent=t,})
  320.     lh=ins("Motor6D",{Name="Left Hip",Part0=t,Part1=ll,C0=lhC0,C1=lhC1,Parent=t,})
  321. elseif Type=="R15" then
  322.     h,hrp=Char.Head,Char.HumanoidRootPart
  323.     ut,lt=Char.UpperTorso,Char.LowerTorso
  324.     rua,rla,rh=Char.RightUpperArm,Char.RightLowerArm,Char.RightHand
  325.     lua,lla,lh=Char.LeftUpperArm,Char.LeftLowerArm,Char.LeftHand
  326.     rul,rll,rf=Char.RightUpperLeg,Char.RightLowerLeg,Char.RightFoot
  327.     lul,lll,lf=Char.LeftUpperLeg,Char.LeftLowerLeg,Char.LeftFoot
  328.     for i,v in pairs(Char:GetDescendants()) do
  329.         if v:IsA("Motor6D") then
  330.             local CFData={C0=cf(v.C0.Position),C1=cf(v.C1.Position),Part0=v.Part0,Part1=v.Part1,Parent=v.Parent}
  331.             local Joint=ins("Motor6D",{C0=CFData.C0,C1=CFData.C1,Part0=CFData.Part0,Part1=CFData.Part1,Name=v.Name,Parent=CFData.Parent,})
  332.             CFs[v.Name]=CFData
  333.             Joints[v.Name]=setmetatable({Object=Joint,Link=CFData,Remove=function(Time) Instance.Remove(Joint,Time) end},{__index=Joint,__newindex=function(self,k,v) Joint[k]=v end})
  334.             v.Parent=nil
  335.             Instance.Remove(v)
  336.         end
  337.     end
  338. end
  339. --// Variables
  340. local Using,Muted,Hold=false,false,false
  341. local Sine=0
  342. local Change=1
  343. local WS,JP=16,50
  344. local TimePos=0
  345. local PullTick=tick()
  346. local Step="R"
  347. local FreeParts,BusyParts={Rocks={},Explosions={}},{}
  348. local Rocks,Explosions=10,10
  349. local StepSounds={Glass=4085889170,Plastic=2812418291,SmoothPlastic=2812418291,Neon=2812418291,ForceField=2812418291,Metal=2812417769,DiamondPlate=2812417769,CorrodedMetal=2812417769,Foil=2812417769,Sand=4085867669,Grass=619188333,Slate=2812418291,Concrete=2812418291,Granite=2812418291,Pebble=2812418291,Marble=2812418291,Cobblestone=2812418291,Brick=2812418291,Water=1110489303,Wood=2812419402,WoodPlanks=2812419402,Fabric=133705377,Snow=619083295}
  350. local Poses={CFrame.Angles(-2.5,0,0,true),cf(0,0,0),cf(-0.1,-0.1,0.05)*angles(5,10,-2.5,true),cf(0.1,-0.1,0.05)*angles(5,-10,2.5,true),cf(0,0,-0.05)*angles(-1,-2.5,1.5,true),cf(0,0,-0.05)*angles(-1,2.5,-1.5,true)}
  351. --// Setup 2
  352. local Effects=ins("Folder",{Name="Effects",Parent=Char,})
  353. ins("ForceField",{Parent=char,Visible=false,})
  354. local FootstepR=Sound(1941274854,6,1,rl,250,5,true) FootstepR.Looped=false FootstepR:Stop()
  355. local FootstepL=Sound(1941274854,6,1,ll,250,5,true) FootstepL.Looped=false FootstepL:Stop()
  356. local Mus=Sound(6153847391,1.25,1,t,150,5,true)
  357. local Prep=Sound(5568128427,1.5,1,h,150,5,true)  Prep.Looped=false Prep:Stop()
  358. local Reload
  359. local BPU,BPD,BP={},{},{}
  360. local Bo=ins("Model",{Name="rocK",Parent=t})
  361. local BowHandle=ins("Part",{Size=v3(.225,1,.225),CanCollide=false,Anchored=false,Massless=true,Locked=true,Color=rgb(150,150,150),Material="Slate",Parent=Bo})
  362. local Rock=ins("Part",{Size=v3(.356,.356,3.338),CanCollide=false,Anchored=false,Massless=true,Locked=true,Parent=Bo})
  363. local BHM=ins("CylinderMesh",BowHandle)
  364. local RM=ins("SpecialMesh",{MeshId="rbxassetid://6163504268",TextureId="rbxassetid://6163510254",Parent=Rock})
  365. local HW=ins("Motor6D",{Part0=ra,Part1=Rock,C0=cf(-.1,-.85,0),C1=cf(0,0,1.25),Parent=Bo})
  366. local BW=ins("Motor6D",{Part0=Rock,Part1=BowHandle,C0=cf(0,0,-1.5),Parent=Rock})
  367. local SP=ins("Part",{Size=v3(),CanCollide=false,Anchored=false,Massless=true,Locked=true,Transparency=1,Parent=Bo})
  368. local SPW=ins("Motor6D",{Part0=BowHandle,Part1=SP,C1=cf(0,0,-1),Parent=BowHandle})
  369. for i=1,3 do
  370.     local AttPart=i==1 and BowHandle or BPU[#BPU][1]
  371.     local P=ins("Part",{Size=v3(.225-(i*.025),1,.225-(i*.025)),CanCollide=false,Anchored=false,Massless=true,Locked=true,Color=bc("Brown").Color,Material="Wood",Name=i==3 and "Top" or "meh",Parent=Bo})
  372.     ins("CylinderMesh",P)
  373.     local W=ins("Motor6D",{Part0=AttPart,Part1=P,C0=cf(0,AttPart.Size.Y/2,0)*angles(10,0,0,true),C1=cf(0,-P.Size.Y/2,0),Parent=P})
  374.     if i==3 then BPU.Top={P,W,cf(0,AttPart.Size.Y/2,0)*angles(10,0,0,true)} else table.insert(BPU,{P,W,cf(0,AttPart.Size.Y/2,0)*angles(10,0,0,true)}) end
  375. end
  376. for i=1,3 do
  377.     local AttPart=i==1 and BowHandle or BPD[#BPD][1]
  378.     local P=ins("Part",{Size=v3(.225-(i*.025),1,.225-(i*.025)),CanCollide=false,Anchored=false,Massless=true,Locked=true,Color=bc("Brown").Color,Material="Wood",Name=i==3 and "Bottom" or "meh",Parent=Bo})
  379.     ins("CylinderMesh",P)
  380.     local W=ins("Motor6D",{Part0=AttPart,Part1=P,C0=angles(0,0,i==1 and 180 or 0,true)*cf(0,AttPart.Size.Y/2,0)*angles(10,0,0,true),C1=cf(0,-P.Size.Y/2,0),Parent=P})
  381.     if i==3 then BPD.Bottom={P,W,angles(0,0,i==1 and 180 or 0,true)*cf(0,AttPart.Size.Y/2,0)*angles(10,0,0,true)} else table.insert(BPD,{P,W,angles(0,0,i==1 and 180 or 0,true)*cf(0,AttPart.Size.Y/2,0)*angles(10,0,0,true)}) end
  382. end
  383. for i,v in pairs(BPU) do BP[i]=v end
  384. for i,v in pairs(BPD) do BP[i]=v end
  385. BPU,BPD=nil,nil
  386. local A1,A2,A3=ins("Attachment",{Position=v3(),Parent=SP}),ins("Attachment",{Position=v3(0,.5,0),Parent=BP.Top[1]}),ins("Attachment",{Position=v3(0,.5,0),Parent=BP.Bottom[1]})
  387. local B1,B2=ins("Beam",{FaceCamera=true,Transparency=ns(0),Attachment0=A2,Attachment1=A1,Width0=.09,Width1=.09,LightInfluence=1,Parent=A2}),ins("Beam",{FaceCamera=true,Transparency=ns(0),Attachment0=A3,Attachment1=A1,Width0=.09,Width1=.09,LightInfluence=1,Parent=A2})
  388. for i=1,Rocks do
  389.     local P=ins("Part",{Size=v3(.356,.356,3.338),CanCollide=false,Anchored=false,Massless=true,Locked=true,Name="GODDAMNROCK"})
  390.     local M=ins("SpecialMesh",{MeshId="rbxassetid://6163504268",TextureId="rbxassetid://6163510254",Name="MESH",Parent=P})
  391.     table.insert(FreeParts.Rocks,{P,M})
  392. end
  393. for i=1,Explosions do
  394.     local P=ins("Part",{Size=v3(),CanCollide=false,Anchored=true,Massless=true,Locked=true})
  395.     local S=Sound(4921099862,1.5,1,P,250,6,true) S:Stop() S.Looped=false S.Name="SOUND"
  396.     local Exp=ins("Explosion")
  397.     Exp.Hit:Connect(function(P,D)
  398.         if not P or not P:IsA("BasePart") or P:IsDescendantOf(char) then return end
  399.         P:BreakJoints()
  400.     end)
  401.     table.insert(FreeParts.Explosions,{P,S,Exp}) --4921099862 6056117937
  402. end
  403. --// Functions
  404. function PlayAnimSingle(...)
  405.     local Joints_={nec=nec,rutj=rutj,rs=rs,ls=ls,rh=rh,lh=lh}
  406.     local CFs_={necC0=necC0,necC1=necC1,rutjC0=rutjC0,rutjC1=rutjC1,rsC0=rsC0,rsC1=rsC1,lsC0=lsC0,lsC1=lsC1,rhC0=rhC0,rhC1=rhC1,lhC0=lhC0,lhC1=lhC1,hamC0=cf(),hamC1=cf(-.1,.1,.85)*angles(90,0,0,true)}
  407.     for i,v in pairs({...}) do
  408.         if Joints_[v[1]] then
  409.             local T={}
  410.             table.foreach(v[2],function(i,v) T[i]=v end)
  411.             local C0=((CFs_[v[1].."C0"] or cf(0,0,0))*(T.C0 or cf(0,0,0))) or CFs_[v[1].."C0"]
  412.             local C1=((CFs_[v[1].."C1"] or cf(0,0,0))*((T.C1 or cf(0,0,0))):Inverse())
  413.             for i,v in pairs(T) do if i=="C0" then T.C0=C0 elseif i=="C1" then T.C1=C1 end end
  414.             Tween(Joints_[v[1]],T,v[3])
  415.         end
  416.     end
  417. end
  418. function PlayAnim(Table,AddFuncs)
  419.     AddFuncs=AddFuncs or {}
  420.     local Waits=Table.Waits
  421.     for i=1,#Table do
  422.         local v=Table[i]
  423.         if i~="Waits" and Waits[i] then
  424.             local WaitTime=Waits[i]
  425.             PlayAnimSingle(unpack(v))
  426.             wait(WaitTime)
  427.             if AddFuncs[i] then AddFuncs[i]() end
  428.         end
  429.     end
  430. end
  431. function TakeCached(Tab,Dur)
  432.     if  #Tab==0 then return warn("no available objects") end
  433.     local Obj=Tab[#Tab]
  434.     Tab[#Tab]=nil
  435.     local Conn
  436.     Conn=Obj[1].AncestryChanged:Connect(function(A)
  437.         if not Obj[1].Parent then
  438.             Conn:Disconnect()
  439.             table.insert(Tab,Obj)
  440.             Obj[1].Parent=nil
  441.             Conn="fuc"
  442.         end
  443.     end)
  444.     coroutine.wrap(function()
  445.         if not Dur then return end
  446.         wait(Dur)
  447.         if Conn=="fuc" then return end
  448.         Conn:Disconnect()
  449.         table.insert(Tab,Obj)
  450.         Obj[1].Parent=nil
  451.     end)()
  452.     return setmetatable(Obj,{__call=function(self) table.insert(Tab,Obj) Obj[1].Parent=nil end,__index=Obj})
  453. end
  454. --// Moves
  455. --// Connections
  456. CrossClient:AddFunction("Event","Impact",function(T)
  457.     local Hit,Pos=T[1],T[2]
  458.     local Obj=TakeCached(FreeParts.Explosions,5)
  459.     if Obj then
  460.         Obj[1].CFrame=cf(Pos)
  461.         Obj[2].SoundId="rbxassetid://"..(math.random(0,1,10)==1 and 6056117937  or 4921099862)
  462.         Obj[1].Parent=Effects
  463.         Obj[2]:Play()
  464.         if Obj[2].SoundId=="rbxassetid://6056117937" then
  465.             Obj[2].TimePosition=.85
  466.             coroutine.wrap(function()
  467.                 wait(Obj[2].TimeLength-1.6)
  468.                 Obj[3].Parent=Obj[1]
  469.                 Obj[3].BlastPressure=5000000
  470.                 Obj[3].Position=Pos
  471.                 wait(2)
  472.                 Obj[1].Parent=nil
  473.             end)()
  474.         else
  475.             coroutine.wrap(function()
  476.                 Obj[3].Parent=Obj[1]
  477.                 Obj[3].BlastPressure=500000
  478.                 Obj[3].Position=Pos
  479.                 wait(2)
  480.                 Obj[1].Parent=nil
  481.             end)()
  482.         end
  483.     else
  484.         Instance.Remove(ins("Explosion",{Position=Pos,Parent=Effects}),2.5)
  485.     end
  486. end)
  487. UIS.InputBegan:Connect(nil,function(IO,L)
  488.     if L then return end
  489.     if IO.UserInputType==Enum.UserInputType.Keyboard then
  490.         if IO.KeyCode==Enum.KeyCode.M then
  491.             Muted=not Muted
  492.         end
  493.     elseif IO.UserInputType==Enum.UserInputType.MouseButton1 and Rock.Transparency~=1 then
  494.         CrossClient:FireClient("Event","ToggleTTM",true)
  495.         Prep:Play()
  496.         Hold=true
  497.         PullTick=tick()
  498.     end
  499. end)
  500. UIS.InputEnded:Connect(nil,function(IO,L)
  501.     if IO.UserInputType==Enum.UserInputType.MouseButton1 and Rock.Transparency~=1 and Hold then
  502.         if tick()-PullTick>.2 then
  503.             CrossClient:FireClient("Event","ToggleTTM",false)
  504.             Prep:Stop()
  505.             PullTick=tick()
  506.             local Obj=TakeCached(FreeParts.Rocks,5)
  507.             if Obj then
  508.                 Obj[1].CFrame=cf(Rock.Position,Mouse.Hit.Position)
  509.                 Obj[1].Parent=Effects
  510.                 pcall(function()
  511.                     Obj[1]:SetNetworkOwner(Player)
  512.                 end)
  513.             end
  514.             Hold=false
  515.             Rock.Transparency=1
  516.             BW.C0=BW.C0*cf(0,0,2)*angles(random(-180,180,10),random(-180,180,10),random(-180,180,10),true)
  517.             Sound(145203279,1.5,random(.9,1.1,100),Rock,100,5)
  518.             for i,v in pairs(BP) do
  519.                 v[2].C0=v[2].C0*angles(random(-180,180,10),random(-180,180,10),random(-180,180,10),true)
  520.             end
  521.         else
  522.             Prep:Stop()
  523.             CrossClient:FireClient("Event","ToggleTTM",false)
  524.             Hold=false
  525.         end
  526.     end
  527. end)
  528. game:GetService("RunService").Heartbeat:Connect(function()
  529.     if not FootstepR or not FootstepR.Parent then FootstepR=Sound(1941274854,6,1,rl,250,5,true) FootstepR.Looped=false FootstepR:Stop() end
  530.     if not FootstepL or not FootstepL.Parent then FootstepL=Sound(1941274854,6,1,ll,250,5,true) FootstepL.Looped=false FootstepL:Stop() end
  531.     if not Prep or not Prep.Parent then Prep=Sound(5568128427,1.5,1,h,150,5,true)  Prep.Looped=false Prep:Stop() end
  532.     if not Reload or not Reload.Parent then Reload=Sound(506273075,.75,1,Rock,150,5,true)  Reload.Looped=false Reload:Stop() end
  533.     if not Mus or not Mus.Parent then Mus=Sound(6153847391,Muted and 0 or 1.25,1,t,150,5,true) Mus.TimePosition=TimePos end
  534.     Mus.SoundId,Mus.Volume,Mus.Pitch="rbxassetid://"..4673981188,Muted and 0 or .85,1
  535.     TimePos=Mus.TimePosition
  536.     Sine=Sine+Change
  537.     local Direction=hum.MoveDirection
  538.     if Direction.Magnitude==0 then Direction=hrp.Velocity/7.5 end;
  539.     local MoveZ=clamp((Direction*t.CFrame.LookVector).X+(Direction*t.CFrame.LookVector).Z,-1,1)
  540.     local MoveX=clamp((Direction*t.CFrame.RightVector).X+(Direction*t.CFrame.RightVector).Z,-1,1)
  541.     local Moving=(hrp.Velocity*v3(1,0,1)).Magnitude>1
  542.     local VerY=hrp.Velocity.Y
  543.     local StandR,RPos,RNID=Raycast(t.CFrame*cf(t.Size.X/4,-t.Size.Y/2,0).Position,-t.CFrame.UpVector,{char},3,false)
  544.     local StandL,LPos,LNID=Raycast(t.CFrame*cf(-t.Size.X/4,-t.Size.Y/2,0).Position,-t.CFrame.UpVector,{char},3,false)
  545.     local Stand=StandR or StandL
  546.     if not Hold and tick()-PullTick>.25 and Rock.Transparency==1 then
  547.         Rock.Transparency=0
  548.         Reload.Pitch=random(.9,1.1,100)
  549.         Reload:Play()
  550.     end
  551.     --hum.WalkSpeed,hum.JumpPower=WS,JP
  552.     if not Moving and Stand then
  553.         local IdleVal=(tan(Sine/10)*cos(Sine/35))*20
  554.         Change=1
  555.         nec.C0=nec.C0:Lerp(necC0*cf(0,0,0)*angles(sin(Sine/IdleVal)*6,cotan(Sine/(IdleVal*3))*22.5,0,true)*Poses[1]*(Hold and (angles(0,50,0,true)*angles(0,0,-25,true)) or cf()),.25)
  556.         rutj.C0=rutj.C0:Lerp(rutjC0*cf(0,.15*cos(Sine/IdleVal),.15*cotan(Sine/IdleVal))*angles(cotan(Sine/IdleVal)*6,sin(Sine/(IdleVal*3.5))*7.5,cotan(Sine/(IdleVal*2))*-12,true)*Poses[2]*(Hold and (angles(0,-50,0,true)) or cf()),.25)
  557.         rs.C0=rs.C0:Lerp(rsC0*cf(0,-.15*cos(Sine/IdleVal),0)*angles(sin(Sine/IdleVal)*6.75,-sin(Sine/(IdleVal*3.5))*7.5,sin(Sine/IdleVal)*4.5,true)*Poses[3]*(Hold and (CFrame.new(0.1,0,0.25)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(math.rad(90),math.rad(20),math.rad(-10))*cf(0,.2,0)) or cf()),.25)
  558.         ls.C0=ls.C0:Lerp(lsC0*cf(0,-.15*cos(Sine/IdleVal),0)*angles(sin(Sine/IdleVal)*6.75,-sin(Sine/(IdleVal*3.5))*7.5,sin(Sine/IdleVal)*-4.5,true)*Poses[4]*(Hold and (CFrame.new(0,0,-0.6)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(math.rad(90),math.rad(0),math.rad(-10))*cf(0,-.2,0)) or cf()),.25)
  559.         rh.C0=rh.C0:Lerp(rhC0*cf(0,-.15*cos(Sine/IdleVal)+.075*cotan(Sine/(IdleVal*2)),0)*angles(cotan(Sine/IdleVal)*-6+sin(Sine/(IdleVal*10.5))*-3.75,0,cotan(Sine/(IdleVal*2))*19.5,true)*Poses[5]*(Hold and (angles(0,-5,0,true)) or cf()),.25)
  560.         lh.C0=lh.C0:Lerp(lhC0*cf(0,-.15*cos(Sine/IdleVal)-.075*cotan(Sine/(IdleVal*2)),0)*angles(cotan(Sine/IdleVal)*-6+sin(Sine/(IdleVal*10.5))*3.65,0,cotan(Sine/(IdleVal*2))*19.5,true)*Poses[6]*(Hold and (angles(0,50,0,true)) or cf()),.25)
  561.         HW.C0=HW.C0:Lerp(cf(-.1,-.85-(Hold and Rock.Size.Z*.25 or 0),0)*angles(Hold and -90 or 0,0,0,true),.25)
  562.         BW.C0=BW.C0:Lerp(cf(0,0,Hold and -.4 or Rock.Transparency~=0 and 1.5 or -1.5),.25)
  563.         RM.Scale=RM.Scale:Lerp(v3(1,1,Hold and 1.25 or 1),.25)
  564.         SPW.C0=SPW.C0:Lerp(cf(0,0,Hold and 1.5 or 0),.25)
  565.         for i,v in pairs(BP) do
  566.             v[2].C0=v[2].C0:Lerp(v[3]*angles(Hold and 10 or Rock.Transparency~=0 and -10 or 0,0,0,true),.25)
  567.         end
  568.     elseif Moving and Stand then
  569.         local WSVal=4/clamp(hum.WalkSpeed/16,.25,2)*t.Size.Y/2
  570.         local WSMul=(1+(WSVal/4))
  571.         Change=1
  572.         nec.C0=nec.C0:Lerp(necC0*cf(0,0,0)*angles(sin(Sine/(WSVal/2))*115,0,0,true)*cf(0,0,0)*angles(5*MoveZ,-60*MoveX,0,true)*(Hold and (angles(0,50,0,true)*angles(0,0,-25,true)) or cf()),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3) --*cf((VerY/7.5)*MoveX,1*clamp(abs(VerY),0,1),(-VerY/7.5)*MoveZ)
  573.         rutj.C0=rutj.C0:Lerp(rutjC0*cf(0,-2,0)*angles(VerY*2.5*MoveZ,0,VerY*2.5*MoveX,true)*cf(0,2,0)*cf(0,2.5*cos(Sine/(WSVal/2)),0)*angles(cotan(Sine/(WSVal/2))*225,sin(Sine/WSVal)*10,0,true)*cf(0,0,0)*angles(-10*MoveZ,0,-10*MoveX,true)*(Hold and (angles(0,-50,0,true)) or cf()),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  574.         rs.C0=rs.C0:Lerp(rsC0*cf(0,0,.5*sin(Sine/WSVal)*MoveZ)*angles(-cotan(Sine/WSVal)*330*MoveZ*(Hold and 0 or 1),0,0,true)*angles(0,-cotan(Sine/WSVal)*70*MoveZ*(Hold and 0 or 1),0,true)*cf(-.15*(Hold and 0 or 1),0,0)*angles(10*(Hold and 0 or 1),0,-10*abs(MoveZ)*(Hold and 0 or 1),true)*(Hold and (CFrame.new(0.1,0,0.25)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(math.rad(90),math.rad(20),math.rad(-10))*cf(0,.2,0)) or cf()),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  575.         ls.C0=ls.C0:Lerp(lsC0*cf(0,0,-.5*sin(Sine/WSVal)*MoveZ)*angles(cotan(Sine/WSVal)*330*MoveZ*(Hold and 0 or 1),0,0,true)*angles(0,-cotan(Sine/WSVal)*70*MoveZ*(Hold and 0 or 1),0,true)*cf(.15*(Hold and 0 or 1),0,0)*angles(10*(Hold and 0 or 1),0,10*abs(MoveZ)*(Hold and 0 or 1),true)*(Hold and (CFrame.new(0,0,-0.6)*CFrame.Angles(math.rad(0),math.rad(50),math.rad(0))*CFrame.Angles(math.rad(90),math.rad(0),math.rad(-10))*cf(0,-.2,0)) or cf()),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  576.         rh.C0=rh.C0:Lerp(rhC0*cf(0,.1+.75*cos(Sine/WSVal),-.2-.9*cos(Sine/WSVal))*angles(cotan(Sine/WSVal)*250*MoveZ,0,cotan(Sine/WSVal)*200*MoveX,true)*cf(0,0,0)*angles(7.5*abs(MoveZ),0,0,true)*(Hold and (angles(0,-5,0,true)) or cf()),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  577.         lh.C0=lh.C0:Lerp(lhC0*cf(0,.1+-.75*cos(Sine/WSVal),-.2+.9*cos(Sine/WSVal))*angles(-cotan(Sine/WSVal)*250*MoveZ,0,-cotan(Sine/WSVal)*200*MoveX,true)*cf(0,0,0)*angles(7.5*abs(MoveZ),0,0,true)*(Hold and (angles(0,50,0,true)) or cf()),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  578.         HW.C0=HW.C0:Lerp(cf(-.1,-.85-(Hold and Rock.Size.Z*.25 or 0),0)*angles(Hold and -90 or 0,0,0,true),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  579.         BW.C0=BW.C0:Lerp(cf(0,0,Hold and -.4 or Rock.Transparency~=0 and 1.5 or -1.5),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  580.         RM.Scale=RM.Scale:Lerp(v3(1,1,Hold and 1.25 or 1),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  581.         SPW.C0=SPW.C0:Lerp(cf(0,0,Hold and 1.5 or 0),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  582.         for i,v in pairs(BP) do
  583.             v[2].C0=v[2].C0:Lerp(v[3]*angles(Hold and 10 or Rock.Transparency~=0 and -10 or 0,0,0,true),.35/(t.Size.Y/2)*(hum.WalkSpeed/16)/3)
  584.         end
  585.         --thanks to kyu or neb.. whatever
  586.         if cos(Sine/WSVal)/2>.2 and Step=="L" then
  587.             Step="R"
  588.             if StandR then
  589.                 FootstepR.Pitch=random(.9,1.1,100)
  590.                 FootstepR:Play()
  591.             end
  592.         end
  593.         if cos(Sine/WSVal)/2<-.2 and Step=="R" then
  594.             Step="L"
  595.             if StandL then
  596.                 FootstepL.Pitch=random(.9,1.1,100)
  597.                 FootstepL:Play()
  598.             end
  599.         end
  600.     elseif not Stand then
  601.         Change=1
  602.         nec.C0=nec.C0:Lerp(necC0*cf(0,0,0)*angles(0,0,0,true)*cf(0,0,0)*angles(clamp(hrp.Velocity.Y,-15,15),0,0,true),.2)
  603.         rutj.C0=rutj.C0:Lerp(rutjC0*cf(0,0,0)*angles(0,0,0,true)*cf(0,0,0)*angles(clamp(hrp.Velocity.Y,-30,20),0,0,true),.2)
  604.         rs.C0=rs.C0:Lerp(rsC0*cf(0,0,0)*angles(0,5,-7.5,true)*cf(-(clamp(hrp.Velocity.Y/20,-.45,0)),0,0)*angles((clamp(hrp.Velocity.Y*4,0,150)),0,-(clamp(hrp.Velocity.Y*4,-120,0)),true),.2)
  605.         ls.C0=ls.C0:Lerp(lsC0*cf(0,0,0)*angles(0,-5,7.5,true)*cf((clamp(hrp.Velocity.Y/20,-.45,0)),0,0)*angles((clamp(hrp.Velocity.Y*4,0,150)),0,(clamp(hrp.Velocity.Y*4,-120,0)),true),.2)
  606.         rh.C0=rh.C0:Lerp(rhC0*cf(0,0,0)*angles(0,0,0,true)*cf(0,.4,-.35)*angles(-10,-5,5,true),.2)
  607.         lh.C0=lh.C0:Lerp(lhC0*cf(0,0,0)*angles(clamp(-hrp.Velocity.Y,-25,35),0,0,true)*cf(0,.2,-.15)*angles(-2.5,5,-5,true),.2)
  608.     end
  609.     if Type=="R6" then
  610.         nec.C1=nec.C1:Lerp(necC1,.2)
  611.         rutj.C1=rutj.C1:Lerp(rutjC1,.2)
  612.         rs.C1=rs.C1:Lerp(rsC1,.2)
  613.         ls.C1=ls.C1:Lerp(lsC1,.2)
  614.         rh.C1=rh.C1:Lerp(rhC1,.2)
  615.         lh.C1=lh.C1:Lerp(lhC1,.2)
  616.         necC0,necC1=cf(0,t.Size.Y/2,0),cf(0,-h.Size.Y/2,0)
  617.         rutjC0,rutjC1=cf(0,0,0),cf(0,0,0)
  618.         rsC0,rsC1=cf(t.Size.X/2,t.Size.Y/4,0),cf(-ra.Size.X/2,ra.Size.Y/4,0)
  619.         lsC0,lsC1=cf(-t.Size.X/2,t.Size.Y/4,0),cf(la.Size.X/2,la.Size.Y/4,0)
  620.         rhC0,rhC1=cf(t.Size.X/4,-t.Size.Y/2,0),cf(0,rl.Size.Y/2,0)
  621.         lhC0,lhC1=cf(-t.Size.X/4,-t.Size.Y/2,0),cf(0,ll.Size.Y/2,0)
  622.     end
  623. end)
Add Comment
Please, Sign In to add comment