Advertisement
5325325325

Untitled

Nov 28th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.19 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = owner
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local h,t
  75. --Give the server mouse data 30 times every second, but only if the values changed
  76. --If player is not moving their mouse, client won't fire events
  77. while wait(1/30) do
  78. if h~=Mouse.Hit or t~=Mouse.Target then
  79. h,t=Mouse.Hit,Mouse.Target
  80. Event:FireServer({isMouse=true,Target=t,Hit=h})
  81. end
  82. end]==],Player.Character)
  83. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  84. end
  85.  
  86. local Players = game:GetService("Players")
  87. local LocalPlayer = owner
  88.  
  89. local children = game.Workspace:GetChildren()
  90. for _, child in pairs(children) do
  91. for _, child in pairs(child:GetChildren()) do
  92. table.insert(children, child)
  93. end
  94.  
  95. 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
  96. child:Destroy()
  97. end
  98. end
  99.  
  100. game.Lighting.FogEnd = 50
  101. game.Lighting.GlobalShadows = false
  102. game.Lighting.Brightness = 0.3
  103. game.Lighting.TimeOfDay = 0
  104. game:GetObjects("rbxassetid://654999902")[1].Parent=game.Workspace
  105.  
  106. for _, Player in pairs(Players:GetPlayers()) do
  107. if Player.Character then
  108. Player.Character.HumanoidRootPart.CFrame = game.Workspace.Field.Spawn.CFrame
  109. end
  110. end
  111.  
  112. for _, Player in pairs(Players:GetPlayers()) do
  113. if Player.Character and Player ~= LocalPlayer then
  114. pcall(function()
  115. Player.Character.Name = "Slave"
  116. Player.Character.Head.BrickColor = BrickColor.new("Dirt brown")
  117. Player.Character["Left Arm"].BrickColor = BrickColor.new("Dirt brown")
  118. Player.Character["Right Arm"].BrickColor = BrickColor.new("Dirt brown")
  119. Player.Character["Left Leg"].BrickColor = BrickColor.new("Dirt brown")
  120. Player.Character["Right Leg"].BrickColor = BrickColor.new("Dirt brown")
  121. Player.Character.Torso.BrickColor = BrickColor.new("Dirt brown")
  122. end)
  123. end
  124. Player.CharacterAdded:connect(function()
  125. if Player.Character and Player ~= LocalPlayer then
  126. Player.Character.Name = "Slave"
  127. repeat pcall(function()
  128. Player.Character.Head.BrickColor = BrickColor.new("Dirt brown")
  129. Player.Character["Left Arm"].BrickColor = BrickColor.new("Dirt brown")
  130. Player.Character["Right Arm"].BrickColor = BrickColor.new("Dirt brown")
  131. Player.Character["Left Leg"].BrickColor = BrickColor.new("Dirt brown")
  132. Player.Character["Right Leg"].BrickColor = BrickColor.new("Dirt brown")
  133. Player.Character.Torso.BrickColor = BrickColor.new("Dirt brown")
  134. end) wait() until Player:FindFirstChild("Torso") and Player.Torso.BrickColor == BrickColor.new("Dirt brown")
  135. end
  136. end)
  137. end
  138.  
  139.  
  140. wait(1)
  141.  
  142. local Players = game:GetService("Players")
  143. local RunService = game:GetService("RunService")
  144.  
  145. local Player = owner
  146. local Camera = workspace.CurrentCamera
  147. local Camera = workspace.CurrentCamera
  148. local Character = Player.Character
  149. local Humanoid = Character:FindFirstChild("Humanoid")
  150. local Head = Character:FindFirstChild("Head")
  151. local Torso = Character:FindFirstChild("Torso")
  152. local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
  153. local RightArm = Character:FindFirstChild("Right Arm")
  154. local LeftArm = Character:FindFirstChild("Left Arm")
  155. local RightLeg = Character:FindFirstChild("Right Leg")
  156. local LeftLeg = Character:FindFirstChild("Left Leg")
  157.  
  158.  
  159.  
  160. local Funcs = {}
  161.  
  162.  
  163. local Animation = "Standing"
  164.  
  165.  
  166. local charWelds = {}
  167.  
  168. local Config = {
  169. standingSway = math.pi/45;
  170. walkingSway = math.pi/14;
  171. standingOffset = math.pi/80;
  172. walkingOffset = math.pi/48;
  173. }
  174.  
  175.  
  176.  
  177. Humanoid.WalkSpeed = 22.4
  178. Humanoid.JumpPower = 40
  179.  
  180. --Camera.CameraType = "Scriptable"
  181.  
  182.  
  183.  
  184.  
  185. charWelds.HumanoidRootPart = Instance.new("Weld", HumanoidRootPart)
  186. charWelds.HumanoidRootPart.Part0 = HumanoidRootPart
  187. charWelds.HumanoidRootPart.Part1 = Torso
  188.  
  189. charWelds.rightArmWeld = Instance.new("Weld", Torso)
  190. charWelds.rightArmWeld.Part0 = Torso
  191. charWelds.rightArmWeld.Part1 = RightArm
  192. charWelds.rightArmWeld.C0 = CFrame.new(1.5, .5, 0)
  193. charWelds.rightArmWeld.C1 = CFrame.new(0, .5, 0)
  194.  
  195. charWelds.leftArmWeld = Instance.new("Weld", Torso)
  196. charWelds.leftArmWeld.Part0 = Torso
  197. charWelds.leftArmWeld.Part1 = LeftArm
  198. charWelds.leftArmWeld.C0 = CFrame.new(-1.5, .5, 0)
  199. charWelds.leftArmWeld.C1 = CFrame.new(0, .5, 0)
  200.  
  201. charWelds.rightLegWeld = Instance.new("Weld", Torso)
  202. charWelds.rightLegWeld.Part0 = Torso
  203. charWelds.rightLegWeld.Part1 = RightLeg
  204. charWelds.rightLegWeld.C0 = CFrame.new(.5, -1.5, 0)
  205. charWelds.rightLegWeld.C1 = CFrame.new(0, .5, 0)
  206.  
  207. charWelds.leftLegWeld = Instance.new("Weld", Torso)
  208. charWelds.leftLegWeld.Part0 = Torso
  209. charWelds.leftLegWeld.Part1 = LeftLeg
  210. charWelds.leftLegWeld.C0 = CFrame.new(-.5, -1.5, 0)
  211. charWelds.leftLegWeld.C1 = CFrame.new(0, .5, 0)
  212.  
  213. local Equipment = Instance.new("Folder", Character)
  214.  
  215.  
  216.  
  217.  
  218. function Funcs.CFrameInterpolate(oc, c, v)
  219. local oc1, oc2, oc3, oc4, oc5, oc6, oc7, oc8, oc9, oc10, oc11, oc12 = oc:components()
  220. local c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12 = c:components()
  221. return CFrame.new(
  222. oc1 + (c1 - oc1) * v, oc2 + (c2 - oc2) * v, oc3 + (c3 - oc3) * v, oc4 + (c4 - oc4) * v, oc5 + (c5 - oc5) * v, oc6 + (c6 - oc6) * v
  223. , oc7 + (c7 - oc7) * v, oc8 + (c8 - oc8) * v, oc9 + (c9 - oc9) * v, oc10 + (c10 - oc10) * v, oc11 + (c11 - oc11) * v, oc12 + (c12 - oc12) * v
  224. )
  225. end
  226.  
  227. function Funcs.Trail(p, c1, c2)
  228. local mag = (c2.p - c1.p).magnitude
  229. p.Size = Vector3.new(0, 0, mag)
  230. p.CFrame = CFrame.new(c1.p:Lerp(c2.p, 0.5))
  231. p.CFrame = CFrame.new(p.CFrame.p, c2.p)
  232. end
  233.  
  234. function Funcs.AngleInterpolate(w,c,x,y,z,x1,y1,z1,l)
  235. w.C1 = c * CFrame.fromEulerAnglesXYZ(
  236. x + math.sin(math.pi / 2 * l) * (x1 - x)
  237. , y + math.sin(math.pi / 2 * l) * (y1 - y)
  238. , z + math.sin(math.pi / 2 * l) * (z1 - z)
  239. )
  240. end
  241.  
  242. function Funcs.Part(Parent, t)
  243. local Part = Instance.new("Part", Parent)
  244. Part.BrickColor = t[2]
  245. Part.FormFactor = 3
  246. Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface
  247. , Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10
  248. Part.CanCollide = t[1]
  249. Part.Transparency = t[3]
  250. Part.Material = t[4]
  251. Part.Reflectance = t[5]
  252. Part.Shape = t[6]
  253. Part.Size = t[7]
  254. return Part
  255. end
  256.  
  257. function Funcs.BlockMesh(Part, Scale)
  258. local BlockMesh = Instance.new("BlockMesh", Part)
  259. BlockMesh.Scale = Scale
  260. return BlockMesh
  261. end
  262.  
  263. function Funcs.CylinderMesh(Part, Scale)
  264. local CylinderMesh = Instance.new("CylinderMesh", Part)
  265. CylinderMesh.Scale = Scale
  266. return CylinderMesh
  267. end
  268.  
  269. function Funcs.SpecialMesh(Part, Scale, MeshType)
  270. local SpecialMesh = Instance.new("SpecialMesh", Part)
  271. SpecialMesh.Scale = Scale
  272. SpecialMesh.MeshType = MeshType
  273. return SpecialMesh
  274. end
  275.  
  276. function Funcs.Weld(Part0, Part1, C0)
  277. local Weld = Instance.new("Weld", Part0)
  278. Weld.Part0, Weld.Part1, Weld.C0 = Part0, Part1, C0
  279. return Weld
  280. end
  281.  
  282. function Funcs.AddEquipment()
  283.  
  284. Whip = Funcs.Part(Equipment, {true, BrickColor.new("Brown"), 0, Enum.Material.SmoothPlastic, 0, Enum.PartType.Block, Vector3.new(0.2, 0.2, 1.6)})
  285. local WhipWeld = Funcs.Weld(RightArm, Whip, CFrame.new(0, -1.1, -0.6))
  286.  
  287. Rope = Funcs.Part(Equipment, {false, BrickColor.new("Really black"), 0, Enum.Material.SmoothPlastic, 0, Enum.PartType.Block, Vector3.new(0, 0, 1)})
  288. local RopeMesh = Funcs.BlockMesh(Rope, Vector3.new(0.4, 0.4, 1))
  289. Rope.Anchored = true
  290.  
  291. RopeE = Funcs.Part(Equipment, {false, BrickColor.new("Dark stone grey"), 0, Enum.Material.SmoothPlastic, 0, Enum.PartType.Block, Vector3.new(0, 0, 0)})
  292. local RopeEMesh = Funcs.SpecialMesh(RopeE, Vector3.new(0.8, 0.8, 0.8), "Sphere")
  293. RopeE.Anchored = true
  294.  
  295. end
  296.  
  297. local ropeEnd = CFrame.new(0, 0, 0)
  298.  
  299. function Funcs.Whip()
  300. if Animation ~= "Throwing" then
  301. Animation = "Throwing"
  302.  
  303. for i = 0, 1, 0.1 do
  304. Funcs.AngleInterpolate(charWelds.HumanoidRootPart, CFrame.new(0, 0, 0)
  305. , 0, 0, 0, 0, math.pi / 8, 0, i)
  306. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  307. , 0, 0, -math.pi / 8, -math.pi * 5 / 4, 0, math.pi / 12, i)
  308. wait()
  309. end
  310.  
  311. local targ = Mouse.Target
  312. local cf = Mouse.Hit
  313.  
  314. for i = 0, 1, 0.2 do
  315. Funcs.AngleInterpolate(charWelds.HumanoidRootPart, CFrame.new(0, 0, 0)
  316. , 0, math.pi / 8, 0, 0, 0, 0, i)
  317. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  318. , -math.pi * 5 / 4, 0, math.pi / 8, 0, 0, -math.pi / 12, i)
  319. wait()
  320. end
  321.  
  322. if (Torso.Position - cf.p).magnitude < 120 then
  323. ropeEnd = cf
  324.  
  325. wait(1 / 2)
  326. if targ and targ.Parent and targ.Parent:FindFirstChild("Humanoid") then
  327. targ.Parent:BreakJoints()
  328. end
  329.  
  330. ropeEnd = Whip.CFrame * CFrame.new(0, -1.8, -0.7)
  331. end
  332.  
  333. Animation = "Standing"
  334. end
  335. end
  336.  
  337. local Snd = Instance.new("Sound", Torso)
  338. Snd.SoundId = "rbxassetid://163277488"
  339. Snd.Volume = 100
  340.  
  341. Mouse.Button1Down:connect(function()
  342. Snd:Play()
  343. Funcs.Whip()
  344. end)
  345.  
  346.  
  347. Funcs.AddEquipment()
  348.  
  349. local i = 0
  350. local camGoal = Head.CFrame
  351. local ropeCEnd = RightArm.CFrame
  352. ropeEnd = Whip.CFrame * CFrame.new(0, -1.8, -0.7)
  353.  
  354.  
  355. RunService.Stepped:connect(function()
  356.  
  357.  
  358. local animSpeed = 0.02
  359. local offsetMultiplier = 1
  360.  
  361.  
  362. local ropeStart = Whip.CFrame * CFrame.new(0, 0, -0.7)
  363. ropeCEnd = CFrame.new(ropeCEnd.p:Lerp(ropeEnd.p, 0.2))
  364. RopeE.CFrame = ropeCEnd
  365. if Animation ~= "Throwing" then
  366. ropeEnd = Whip.CFrame * CFrame.new(0, -1.8, -0.7)
  367. end
  368.  
  369. Funcs.Trail(Rope, ropeStart, ropeCEnd)
  370.  
  371.  
  372.  
  373. if Humanoid.Jump == true then
  374. if Animation ~= "Throwing" then
  375. Animation = "Jumping"
  376.  
  377. end
  378. animSpeed = 0.001
  379. offsetMultiplier = 3
  380. elseif Torso.Velocity.magnitude > 0.4 then
  381. if Animation ~= "Throwing" then
  382. Animation = "Walking"
  383. end
  384. animSpeed = 0.1
  385. offsetMultiplier = 1
  386. else
  387. if Animation ~= "Throwing" then
  388. Animation = "Standing"
  389. end
  390. animSpeed = 0.02
  391. offsetMultiplier = 1
  392. end
  393.  
  394.  
  395. if i < 2 then
  396. i = i + animSpeed
  397. else
  398. i = 0
  399. end
  400.  
  401.  
  402. if Animation == "Standing" or Animation == "Throwing" then
  403. if i < 1 then
  404. if Animation ~= "Throwing" then
  405. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  406. , Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, i)
  407. end
  408. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  409. , -Config.standingSway, 0, Config.standingOffset * offsetMultiplier, Config.standingSway, 0, Config.standingOffset * offsetMultiplier, i)
  410. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  411. , Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, -Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, i)
  412. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  413. , -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, i)
  414. elseif i >= 1 then
  415. if Animation ~= "Throwing" then
  416. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  417. , -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, Config.standingSway, 0, -Config.standingOffset * offsetMultiplier, i - 1)
  418. end
  419. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  420. , Config.standingSway, 0, Config.standingOffset * offsetMultiplier, -Config.standingSway, 0, Config.standingOffset * offsetMultiplier, i - 1)
  421. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  422. , -Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, Config.standingSway, 0, Config.standingOffset * offsetMultiplier / 2, i - 1)
  423. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  424. , Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, -Config.standingSway, 0, -Config.standingOffset * offsetMultiplier / 2, i - 1)
  425. end
  426. end
  427. if Animation == "Walking" or Animation == "Jumping" or Animation == "Throwing" or Animation == "Shooting" then
  428. if i < 1 then
  429. if Animation ~= "Throwing" then
  430. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  431. , Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, i)
  432. end
  433. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  434. , -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, i)
  435. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  436. , Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, i)
  437. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  438. , -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, i)
  439. elseif i >= 1 then
  440. if Animation ~= "Throwing" then
  441. Funcs.AngleInterpolate(charWelds.rightArmWeld, CFrame.new(0,.5,0)
  442. , -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier, i - 1)
  443. end
  444. Funcs.AngleInterpolate(charWelds.leftArmWeld, CFrame.new(0,.5,0)
  445. , Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier, i - 1)
  446. Funcs.AngleInterpolate(charWelds.leftLegWeld, CFrame.new(0,.5,0)
  447. , -Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, Config.walkingSway, 0, Config.walkingOffset * offsetMultiplier / 2, i - 1)
  448. Funcs.AngleInterpolate(charWelds.rightLegWeld, CFrame.new(0,.5,0)
  449. , Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, -Config.walkingSway, 0, -Config.walkingOffset * offsetMultiplier / 2, i - 1)
  450. end
  451. end
  452. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement