Sacki

grave

Jun 16th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.34 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3.  
  4. local children = game.Workspace:GetChildren()
  5. for _, child in pairs(children) do
  6. for _, child in pairs(child:GetChildren()) do
  7. table.insert(children, child)
  8. end
  9.  
  10. if child.ClassName ~= "Terrain" and child:IsA("BasePart") and child.Name ~= "Right Leg" and child.Name ~= "Left Leg" and child.Name ~= "Right Arm" and child.Name ~= "Left Arm" and child.Name ~= "Head" and child.Name ~= "Torso" and child.Name ~= "HumanoidRootPart" then
  11. child:Destroy()
  12. end
  13. end
  14.  
  15. game.Lighting.FogEnd = 50
  16. game.Lighting.GlobalShadows = false
  17. game.Lighting.Brightness = 0.3
  18. game.Lighting.TimeOfDay = 0
  19. game:GetObjects("rbxassetid://654999902")[1].Parent=game.Workspace
  20.  
  21. for _, Player in pairs(Players:GetPlayers()) do
  22. if Player.Character then
  23. Player.Character.HumanoidRootPart.CFrame = game.Workspace.Field.Spawn.CFrame
  24. end
  25. end
  26.  
  27. for _, Player in pairs(Players:GetPlayers()) do
  28. if Player.Character and Player ~= LocalPlayer then
  29. pcall(function()
  30. Player.Character.Name = "Slave"
  31. Player.Character.Head.BrickColor = BrickColor.new("Dirt brown")
  32. Player.Character["Left Arm"].BrickColor = BrickColor.new("Dirt brown")
  33. Player.Character["Right Arm"].BrickColor = BrickColor.new("Dirt brown")
  34. Player.Character["Left Leg"].BrickColor = BrickColor.new("Dirt brown")
  35. Player.Character["Right Leg"].BrickColor = BrickColor.new("Dirt brown")
  36. Player.Character.Torso.BrickColor = BrickColor.new("Dirt brown")
  37. end)
  38. end
  39. Player.CharacterAdded:connect(function()
  40. if Player.Character and Player ~= LocalPlayer then
  41. Player.Character.Name = "Slave"
  42. repeat pcall(function()
  43. Player.Character.Head.BrickColor = BrickColor.new("Dirt brown")
  44. Player.Character["Left Arm"].BrickColor = BrickColor.new("Dirt brown")
  45. Player.Character["Right Arm"].BrickColor = BrickColor.new("Dirt brown")
  46. Player.Character["Left Leg"].BrickColor = BrickColor.new("Dirt brown")
  47. Player.Character["Right Leg"].BrickColor = BrickColor.new("Dirt brown")
  48. Player.Character.Torso.BrickColor = BrickColor.new("Dirt brown")
  49. end) wait() until Player:FindFirstChild("Torso") and Player.Torso.BrickColor == BrickColor.new("Dirt brown")
  50. end
  51. end)
  52. end
  53.  
  54.  
  55. wait(1)
  56.  
  57. local Players = game:GetService("Players")
  58. local RunService = game:GetService("RunService")
  59.  
  60. local Player = Players.LocalPlayer
  61. local Camera = workspace.CurrentCamera
  62. local Mouse = Player:GetMouse()
  63. local Camera = workspace.CurrentCamera
  64. local Character = Player.Character
  65. local Humanoid = Character:FindFirstChild("Humanoid")
  66. local Head = Character:FindFirstChild("Head")
  67. local Torso = Character:FindFirstChild("Torso")
  68. local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
  69. local RightArm = Character:FindFirstChild("Right Arm")
  70. local LeftArm = Character:FindFirstChild("Left Arm")
  71. local RightLeg = Character:FindFirstChild("Right Leg")
  72. local LeftLeg = Character:FindFirstChild("Left Leg")
  73.  
  74.  
  75.  
  76. local Funcs = {}
  77.  
  78.  
  79. local Animation = "Standing"
  80.  
  81.  
  82. local charWelds = {}
  83.  
  84. local Config = {
  85. standingSway = math.pi/45;
  86. walkingSway = math.pi/14;
  87. standingOffset = math.pi/80;
  88. walkingOffset = math.pi/48;
  89. }
  90.  
  91.  
  92.  
  93. Humanoid.WalkSpeed = 22.4
  94. Humanoid.JumpPower = 40
  95.  
  96. --Camera.CameraType = "Scriptable"
  97.  
  98.  
  99.  
  100.  
  101. charWelds.HumanoidRootPart = Instance.new("Weld", HumanoidRootPart)
  102. charWelds.HumanoidRootPart.Part0 = HumanoidRootPart
  103. charWelds.HumanoidRootPart.Part1 = Torso
  104.  
  105. charWelds.rightArmWeld = Instance.new("Weld", Torso)
  106. charWelds.rightArmWeld.Part0 = Torso
  107. charWelds.rightArmWeld.Part1 = RightArm
  108. charWelds.rightArmWeld.C0 = CFrame.new(1.5, .5, 0)
  109. charWelds.rightArmWeld.C1 = CFrame.new(0, .5, 0)
  110.  
  111. charWelds.leftArmWeld = Instance.new("Weld", Torso)
  112. charWelds.leftArmWeld.Part0 = Torso
  113. charWelds.leftArmWeld.Part1 = LeftArm
  114. charWelds.leftArmWeld.C0 = CFrame.new(-1.5, .5, 0)
  115. charWelds.leftArmWeld.C1 = CFrame.new(0, .5, 0)
  116.  
  117. charWelds.rightLegWeld = Instance.new("Weld", Torso)
  118. charWelds.rightLegWeld.Part0 = Torso
  119. charWelds.rightLegWeld.Part1 = RightLeg
  120. charWelds.rightLegWeld.C0 = CFrame.new(.5, -1.5, 0)
  121. charWelds.rightLegWeld.C1 = CFrame.new(0, .5, 0)
  122.  
  123. charWelds.leftLegWeld = Instance.new("Weld", Torso)
  124. charWelds.leftLegWeld.Part0 = Torso
  125. charWelds.leftLegWeld.Part1 = LeftLeg
  126. charWelds.leftLegWeld.C0 = CFrame.new(-.5, -1.5, 0)
  127. charWelds.leftLegWeld.C1 = CFrame.new(0, .5, 0)
  128.  
  129. local Equipment = Instance.new("Folder", Character)
  130.  
  131.  
  132.  
  133.  
  134. function Funcs.CFrameInterpolate(oc, c, v)
  135. local oc1, oc2, oc3, oc4, oc5, oc6, oc7, oc8, oc9, oc10, oc11, oc12 = oc:components()
  136. local c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12 = c:components()
  137. return CFrame.new(
  138. oc1 + (c1 - oc1) * v, oc2 + (c2 - oc2) * v, oc3 + (c3 - oc3) * v, oc4 + (c4 - oc4) * v, oc5 + (c5 - oc5) * v, oc6 + (c6 - oc6) * v
  139. , oc7 + (c7 - oc7) * v, oc8 + (c8 - oc8) * v, oc9 + (c9 - oc9) * v, oc10 + (c10 - oc10) * v, oc11 + (c11 - oc11) * v, oc12 + (c12 - oc12) * v
  140. )
  141. end
  142.  
  143. function Funcs.Trail(p, c1, c2)
  144. local mag = (c2.p - c1.p).magnitude
  145. p.Size = Vector3.new(0, 0, mag)
  146. p.CFrame = CFrame.new(c1.p:Lerp(c2.p, 0.5))
  147. p.CFrame = CFrame.new(p.CFrame.p, c2.p)
  148. end
  149.  
  150. function Funcs.AngleInterpolate(w,c,x,y,z,x1,y1,z1,l)
  151. w.C1 = c * CFrame.fromEulerAnglesXYZ(
  152. x + math.sin(math.pi / 2 * l) * (x1 - x)
  153. , y + math.sin(math.pi / 2 * l) * (y1 - y)
  154. , z + math.sin(math.pi / 2 * l) * (z1 - z)
  155. )
  156. end
  157.  
  158. function Funcs.Part(Parent, t)
  159. local Part = Instance.new("Part", Parent)
  160. Part.BrickColor = t[2]
  161. Part.FormFactor = 3
  162. Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface
  163. , Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10
  164. Part.CanCollide = t[1]
  165. Part.Transparency = t[3]
  166. Part.Material = t[4]
  167. Part.Reflectance = t[5]
  168. Part.Shape = t[6]
  169. Part.Size = t[7]
  170. return Part
  171. end
  172.  
  173. function Funcs.BlockMesh(Part, Scale)
  174. local BlockMesh = Instance.new("BlockMesh", Part)
  175. BlockMesh.Scale = Scale
  176. return BlockMesh
  177. end
  178.  
  179. function Funcs.CylinderMesh(Part, Scale)
  180. local CylinderMesh = Instance.new("CylinderMesh", Part)
  181. CylinderMesh.Scale = Scale
  182. return CylinderMesh
  183. end
  184.  
  185. function Funcs.SpecialMesh(Part, Scale, MeshType)
  186. local SpecialMesh = Instance.new("SpecialMesh", Part)
  187. SpecialMesh.Scale = Scale
  188. SpecialMesh.MeshType = MeshType
  189. return SpecialMesh
  190. end
  191.  
  192. function Funcs.Weld(Part0, Part1, C0)
  193. local Weld = Instance.new("Weld", Part0)
  194. Weld.Part0, Weld.Part1, Weld.C0 = Part0, Part1, C0
  195. return Weld
  196. end
  197.  
  198. function Funcs.AddEquipment()
  199.  
  200. Whip = Funcs.Part(Equipment, {true, BrickColor.new("Brown"), 0, Enum.Material.SmoothPlastic, 0, Enum.PartType.Block, Vector3.new(0.2, 0.2, 1.6)})
  201. local WhipWeld = Funcs.Weld(RightArm, Whip, CFrame.new(0, -1.1, -0.6))
  202.  
  203. Rope = Funcs.Part(Equipment, {false, BrickColor.new("Really black"), 0, Enum.Material.SmoothPlastic, 0, Enum.PartType.Block, Vector3.new(0, 0, 1)})
  204. local RopeMesh = Funcs.BlockMesh(Rope, Vector3.new(0.4, 0.4, 1))
  205. Rope.Anchored = true
  206.  
  207. RopeE = Funcs.Part(Equipment, {false, BrickColor.new("Dark stone grey"), 0, Enum.Material.SmoothPlastic, 0, Enum.PartType.Block, Vector3.new(0, 0, 0)})
  208. local RopeEMesh = Funcs.SpecialMesh(RopeE, Vector3.new(0.8, 0.8, 0.8), "Sphere")
  209. RopeE.Anchored = true
  210.  
  211. end
  212.  
  213. local ropeEnd = CFrame.new(0, 0, 0)
  214.  
  215. function Funcs.Whip()
  216. if Animation ~= "Throwing" then
  217. Animation = "Throwing"
  218.  
  219. for i = 0, 1, 0.1 do
  220. Funcs.AngleInterpolate(charWelds.HumanoidRootPart, CFrame.new(0, 0, 0)
  221. , 0, 0, 0, 0, math.pi / 8, 0, i)
  222. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  223. , 0, 0, -math.pi / 8, -math.pi * 5 / 4, 0, math.pi / 12, i)
  224. wait()
  225. end
  226.  
  227. local targ = Mouse.Target
  228. local cf = Mouse.Hit
  229.  
  230. for i = 0, 1, 0.2 do
  231. Funcs.AngleInterpolate(charWelds.HumanoidRootPart, CFrame.new(0, 0, 0)
  232. , 0, math.pi / 8, 0, 0, 0, 0, i)
  233. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  234. , -math.pi * 5 / 4, 0, math.pi / 8, 0, 0, -math.pi / 12, i)
  235. wait()
  236. end
  237.  
  238. if (Torso.Position - cf.p).magnitude < 120 then
  239. ropeEnd = cf
  240.  
  241. wait(1 / 2)
  242. if targ and targ.Parent and targ.Parent:FindFirstChild("Humanoid") then
  243. targ.Parent:BreakJoints()
  244. end
  245.  
  246. ropeEnd = Whip.CFrame * CFrame.new(0, -1.8, -0.7)
  247. end
  248.  
  249. Animation = "Standing"
  250. end
  251. end
  252.  
  253. local Snd = Instance.new("Sound", Torso)
  254. Snd.SoundId = "rbxassetid://163277488"
  255. Snd.Volume = 100
  256.  
  257. Mouse.Button1Down:connect(function()
  258. Snd:Play()
  259. Funcs.Whip()
  260. end)
  261.  
  262.  
  263. Funcs.AddEquipment()
  264.  
  265. local i = 0
  266. local camGoal = Head.CFrame
  267. local ropeCEnd = RightArm.CFrame
  268. ropeEnd = Whip.CFrame * CFrame.new(0, -1.8, -0.7)
  269.  
  270.  
  271. RunService.Stepped:connect(function()
  272.  
  273.  
  274. local animSpeed = 0.02
  275. local offsetMultiplier = 1
  276.  
  277.  
  278. local ropeStart = Whip.CFrame * CFrame.new(0, 0, -0.7)
  279. ropeCEnd = CFrame.new(ropeCEnd.p:Lerp(ropeEnd.p, 0.2))
  280. RopeE.CFrame = ropeCEnd
  281. if Animation ~= "Throwing" then
  282. ropeEnd = Whip.CFrame * CFrame.new(0, -1.8, -0.7)
  283. end
  284.  
  285. Funcs.Trail(Rope, ropeStart, ropeCEnd)
  286.  
  287.  
  288.  
  289. if Humanoid.Jump == true then
  290. if Animation ~= "Throwing" then
  291. Animation = "Jumping"
  292.  
  293. end
  294. animSpeed = 0.001
  295. offsetMultiplier = 3
  296. elseif Torso.Velocity.magnitude > 0.4 then
  297. if Animation ~= "Throwing" then
  298. Animation = "Walking"
  299. end
  300. animSpeed = 0.1
  301. offsetMultiplier = 1
  302. else
  303. if Animation ~= "Throwing" then
  304. Animation = "Standing"
  305. end
  306. animSpeed = 0.02
  307. offsetMultiplier = 1
  308. end
  309.  
  310.  
  311. if i < 2 then
  312. i = i + animSpeed
  313. else
  314. i = 0
  315. end
  316.  
  317.  
  318. if Animation == "Standing" or Animation == "Throwing" then
  319. if i < 1 then
  320. if Animation ~= "Throwing" then
  321. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  322. , Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, i)
  323. end
  324. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  325. , -Config.standingSway, 0, Config.standingOffset * offsetMultiplier, Config.standingSway, 0, Config.standingOffset * offsetMultiplier, i)
  326. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  327. , Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, -Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, i)
  328. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  329. , -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, i)
  330. elseif i >= 1 then
  331. if Animation ~= "Throwing" then
  332. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  333. , -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, i - 1)
  334. end
  335. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  336. , Config.standingSway, 0, Config.standingOffset * offsetMultiplier, -Config.standingSway, 0, Config.standingOffset * offsetMultiplier, i - 1)
  337. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  338. , -Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, i - 1)
  339. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  340. , Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, i - 1)
  341. end
  342. end
  343. if Animation == "Walking" or Animation == "Jumping" or Animation == "Throwing" or Animation == "Shooting" then
  344. if i < 1 then
  345. if Animation ~= "Throwing" then
  346. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  347. , Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, i)
  348. end
  349. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  350. , -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, i)
  351. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  352. , Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, i)
  353. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  354. , -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, i)
  355. elseif i >= 1 then
  356. if Animation ~= "Throwing" then
  357. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  358. , -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, i - 1)
  359. end
  360. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  361. , Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, i - 1)
  362. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  363. , -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, i - 1)
  364. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  365. , Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, i - 1)
  366. end
  367. end
  368. end)
Add Comment
Please, Sign In to add comment