43245245432412343241

Untitled

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