Advertisement
lafur

Untitled

Mar 3rd, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end local Me = game.Players.LocalPlayer
  6. local char = Me.Character
  7. local Torso = char.Torso
  8. local Rarm = char["Right Arm"]
  9. local Larm = char["Left Arm"]
  10. local on = false
  11. local Attkin = true
  12. pcall(function() char[":P"]:remove() end)
  13. pcall(function() char["Parts"]:remove() end)
  14. local Model = Instance.new("Model",char)
  15. Model.Name = ":P"
  16. local prts = Instance.new("Model", char)
  17. prts.Name = "Parts"
  18. local RAB = Instance.new("Part") -- Right Arm Brick
  19. RAB.formFactor = "Custom"
  20. RAB.Size = Vector3.new(0.2, 0.2, 0.2)
  21. RAB.Transparency = 1
  22. RAB.Parent = Model
  23. RAB:BreakJoints()
  24. local RABW = Instance.new("Weld",RAB) -- Right Arm Brick Weld
  25. RABW.Part0 = Torso
  26. RABW.Part1 = RAB
  27. RABW.C1 = CFrame.new(-1.5, -0.5, 0)
  28. local LAB = Instance.new("Part") -- Right Arm Brick
  29. LAB.formFactor = "Custom"
  30. LAB.Size = Vector3.new(0.2, 0.2, 0.2)
  31. LAB.Transparency = 1
  32. LAB.Parent = Model
  33. LAB:BreakJoints()
  34. local LABW = Instance.new("Weld",LAB) -- Left Arm Brick Weld
  35. LABW.Part0 = Torso
  36. LABW.Part1 = LAB
  37. LABW.C1 = CFrame.new(1.5, -0.5, 0)
  38. local RAW = Instance.new("Weld",RAB) -- Right Arm Weld
  39. RAW.Part0 = RAB
  40. RAW.Part1 = nil
  41. RAW.C1 = CFrame.new(0, 0.5, 0)
  42. local LAW = Instance.new("Weld",LAB) -- Left Arm Weld
  43. LAW.Part0 = LAB
  44. LAW.Part1 = nil
  45. LAW.C1 = CFrame.new(0, 0.5, 0)
  46. ----SWORD SHEATHE AND HANDLE------------------------------------
  47. Handle = Instance.new("Part")
  48. Handle.Transparency = 0
  49. Handle.Parent = prts
  50. Handle.formFactor = "Custom"
  51. Handle.Size = Vector3.new(0.25,1,0.25) -- Om nom nom
  52. Handle.BrickColor = BrickColor.new(0.5,0,0)
  53. Handle:BreakJoints()
  54. mesh = Instance.new("CylinderMesh")
  55. mesh.Parent = Handle
  56. mesh.Scale = Vector3.new(1,1,1)
  57. weld = Instance.new("Weld")
  58. weld.Parent = Handle
  59. weld.Part0 = Handle
  60. weld.Part1 = Torso
  61. weld.C0 = CFrame.new(0, -1.5, -0.6) * CFrame.Angles(0, 0, 0.8)
  62. Handle.CanCollide = false
  63. --
  64. end1 = Instance.new("Part")
  65. end1.Transparency = 0
  66. end1.Parent = prts
  67. end1.formFactor = "Custom"
  68. end1.Size = Vector3.new(0.25,0.3,0.25) -- Om nom nom
  69. end1.BrickColor = BrickColor.new("Olive")
  70. end1:BreakJoints()
  71. mesh2 = Instance.new("CylinderMesh")
  72. mesh2.Parent = end1
  73. mesh2.Scale = Vector3.new(1,1,1)
  74. weld2 = Instance.new("Weld")
  75. weld2.Parent = end1
  76. weld2.Part0 = end1
  77. weld2.Part1 = Handle
  78. weld2.C0 = CFrame.new(0, -0.65, 0) * CFrame.Angles(0, 0, 0)
  79. end1.CanCollide = false
  80. --
  81. end2 = Instance.new("Part")
  82. end2.Transparency = 0
  83. end2.Parent = prts
  84. end2.formFactor = "Custom"
  85. end2.Size = Vector3.new(0.25,0.3,0.25) -- Om nom nom
  86. end2.BrickColor = BrickColor.new("Olive")
  87. end2:BreakJoints()
  88. mesh2 = Instance.new("CylinderMesh")
  89. mesh2.Parent = end2
  90. mesh2.Scale = Vector3.new(1,1,1)
  91. weld2 = Instance.new("Weld")
  92. weld2.Parent = end2
  93. weld2.Part0 = end2
  94. weld2.Part1 = Handle
  95. weld2.C0 = CFrame.new(0, 0.65, 0) * CFrame.Angles(0, 0, 0)
  96. end2.CanCollide = false
  97. --
  98. s2 = Instance.new("Part")
  99. s2.Transparency = 0
  100. s2.Parent = prts
  101. s2.formFactor = "Custom"
  102. s2.Size = Vector3.new(3,0.5,0.25) -- Om nom nom
  103. s2.BrickColor = BrickColor.new("Olive")
  104. s2:BreakJoints()
  105. mesh2 = Instance.new("BlockMesh")
  106. mesh2.Parent = s2
  107. mesh2.Scale = Vector3.new(1,1,1)
  108. weld2 = Instance.new("Weld")
  109. weld2.Parent = s2
  110. weld2.Part0 = s2
  111. weld2.Part1 = end2
  112. weld2.C0 = CFrame.new(0, 0.4, 0) * CFrame.Angles(0, 0, 0)
  113. s2.CanCollide = false
  114. ----------BLADE BEGINS :D------------------------
  115. sw2 = Instance.new("Part")
  116. sw2.Transparency = 0
  117. sw2.Parent = prts
  118. sw2.formFactor = "Custom"
  119. sw2.Size = Vector3.new(2.5,6,0.25) -- Om nom nom
  120. sw2.BrickColor = BrickColor.new("Dark stone grey")
  121. sw2:BreakJoints()
  122. mesh2 = Instance.new("BlockMesh")
  123. mesh2.Parent = sw2
  124. mesh2.Scale = Vector3.new(1,1,1)
  125. weld2 = Instance.new("Weld")
  126. weld2.Parent = sw2
  127. weld2.Part0 = sw2
  128. weld2.Part1 = s2
  129. weld2.C0 = CFrame.new(0.25, 3.25, 0) * CFrame.Angles(0, 0, 0)
  130. sw2.CanCollide = false
  131. --
  132. sw22 = Instance.new("Part")
  133. sw22.Transparency = 0
  134. sw22.Parent = prts
  135. sw22.formFactor = "Custom"
  136. sw22.Size = Vector3.new(0.5,6,0.25) -- Om nom nom
  137. sw22.BrickColor = BrickColor.new("Medium stone grey")
  138. sw22:BreakJoints()
  139. mesh2 = Instance.new("BlockMesh")
  140. mesh2.Parent = sw22
  141. mesh2.Scale = Vector3.new(1,1,1)
  142. weld2 = Instance.new("Weld")
  143. weld2.Parent = sw22
  144. weld2.Part0 = sw22
  145. weld2.Part1 = s2
  146. weld2.C0 = CFrame.new(-1.25, 3.25, 0) * CFrame.Angles(0, 0, 0)
  147. sw22.CanCollide = false
  148. --
  149. sw33 = Instance.new("Part")
  150. sw33.Transparency = 0
  151. sw33.Parent = prts
  152. sw33.formFactor = "Custom"
  153. sw33.Size = Vector3.new(0.25,2,3) -- Om nom nom
  154. sw33.BrickColor = BrickColor.new("Medium stone grey")
  155. sw33:BreakJoints()
  156. mesh3 = Instance.new("SpecialMesh")
  157. mesh3.Parent = sw33
  158. mesh3.MeshType = "Wedge"
  159. mesh3.Scale = Vector3.new(1,1,1)
  160. weld3 = Instance.new("Weld")
  161. weld3.Parent = sw33
  162. weld3.Part0 = sw33
  163. weld3.Part1 = s2
  164. weld3.C0 = CFrame.new(0, -7.25, 0) * CFrame.Angles(3.15, -7.85, 0)
  165. sw33.CanCollide = false
  166. --lego
  167. for _, v in pairs(prts:GetChildren()) do
  168. if v.className == "Part" then
  169. v.Locked = true
  170. end
  171. end
  172. --funcs
  173. function damg(part, mag)
  174. for _, v in pairs(game.Players:GetChildren()) do
  175. if (v.Character.Torso.Position - part.Position).magnitude < mag then
  176. if v.Name ~= Me.Name then
  177. v.Character.Humanoid:TakeDamage(15)
  178. end
  179. end
  180. end
  181. end
  182. --end o funcs
  183. if script.Parent.className ~= "HopperBin" then
  184. local h = Instance.new("HopperBin", Me.Backpack)
  185. h.Name = "BBlade"
  186. script.Parent = h
  187. end
  188. local bin = script.Parent
  189. function onSelected(mouse)
  190. Attkin = false
  191. RAW.Part1 = Rarm
  192. RAW.C0 = CFrame.new(0, 0, 0)
  193. LAW.Part1 = Larm
  194. LAW.C0 = CFrame.new(0, 0, 0)
  195. for i = 0, 1, 0.1 do
  196. RAW.C0 = CFrame.Angles(math.rad(225*i), 0, math.rad(-25*i))
  197. wait()
  198. end
  199. weld.Part1 = Rarm
  200. weld.C0 = CFrame.new(-0.5, 0, -1) * CFrame.Angles(-0.8, -0.8, 0.8)
  201. for i = 0, 1, 0.1 do
  202. RAW.C0 = CFrame.Angles(math.rad(225-125*i), 0, math.rad(-25-0*i))
  203. LAW.C0 = CFrame.new(0.95*i, 0, -0.65*i) * CFrame.Angles(math.rad(100*i), 0, math.rad(45*i))
  204. weld.C0 = weld.C0 * CFrame.Angles(0, i/5, i/5) + Vector3.new(i/-10.75, 0, i/8.75)
  205. wait()
  206. end
  207. mouse.Button1Down:connect(function()
  208. if Attkin == false then
  209. Attkin = true
  210. for i = 0, 1, 0.1 do
  211. RAW.C0 = CFrame.Angles(math.rad(100+100*i), 0, math.rad(-25-0*i))
  212. LAW.C0 = CFrame.new(0.95+0*i, 0, -0.65+0*i) * CFrame.Angles(math.rad(100+125*i), 0, math.rad(45+0*i))
  213. wait()
  214. end
  215. for i = 0, 1, 0.1 do
  216. RAW.C0 = CFrame.Angles(math.rad(200-195*i), 0, math.rad(-25-0*i))
  217. LAW.C0 = CFrame.new(0.95+0*i, 0, -0.65+0*i) * CFrame.Angles(math.rad(200-195*i), 0, math.rad(45+0*i))
  218. damg(sw2, 4)
  219. wait()
  220. end
  221. for i = 0, 1, 0.1 do
  222. RAW.C0 = CFrame.Angles(math.rad(5+95*i), 0, math.rad(-25-0*i))
  223. LAW.C0 = CFrame.new(0.95+0*i, 0, -0.65+0*i) * CFrame.Angles(math.rad(5+95*i), 0, math.rad(45+0*i))
  224. wait()
  225. end
  226. Attkin = false
  227. end
  228. end)
  229. mouse.KeyDown:connect(function(key)
  230. if key == "q" and Attkin == false then
  231. Attkin = true
  232. for i = 0, 1, 0.1 do
  233. RAW.C0 = CFrame.Angles(math.rad(100+100*i), 0, math.rad(-25-0*i))
  234. LAW.C0 = CFrame.new(0.95+0*i, 0, -0.65+0*i) * CFrame.Angles(math.rad(100+125*i), 0, math.rad(45+0*i))
  235. wait()
  236. end
  237. for i = 0, 1, 0.1 do
  238. RAW.C0 = CFrame.Angles(math.rad(200-175*i), 0, math.rad(-25-0*i))
  239. LAW.C0 = CFrame.new(0.95+0*i, 0, -0.65+0*i) * CFrame.Angles(math.rad(200-175*i), 0, math.rad(45+0*i))
  240. wait()
  241. end
  242. bv = Instance.new("BodyAngularVelocity")
  243. bv.Parent = Torso
  244. bv.angularvelocity = Vector3.new(0, 20, 0)
  245. bv.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  246. bg = Instance.new("BodyGyro")
  247. bg.Parent = Torso
  248. bg.maxTorque = Vector3.new(0, 0, 0)
  249. on = true
  250. for i = 0, math.huge, 0.1 do
  251. if on == true then
  252. bv.Parent = Torso
  253. bg.Parent = Torso
  254. damg(sw2, 4)
  255. end
  256. if on == false then
  257. bv.Parent = nil
  258. bg.Parent = nil
  259. end
  260. wait()
  261. end
  262. end
  263. if key == "e" and Attkin == false then
  264. for _, v in pairs(game.Players:GetChildren()) do
  265. if v.Name == mouse.Target.Parent.Name then
  266. bin.Parent = v.Backpack
  267. prts.Parent = v.Character
  268. Model.Parent = v.Character
  269. end
  270. end
  271. end
  272. end)
  273. mouse.KeyUp:connect(function(key)
  274. if key == "q" then
  275. on = false
  276. for i = 0, 1, 0.1 do
  277. RAW.C0 = CFrame.Angles(math.rad(25+75*i), 0, math.rad(-25-0*i))
  278. LAW.C0 = CFrame.new(0.95+0*i, 0, -0.65+0*i) * CFrame.Angles(math.rad(25+75*i), 0, math.rad(45+0*i))
  279. wait()
  280. end
  281. Attkin = false
  282. end
  283. end)
  284. end
  285. function onDesel(mouse)
  286. RAW.Part1 = nil
  287. LAW.Part1 = nil
  288. weld.Part1 = Torso
  289. weld.C0 = CFrame.new(0, -1.5, -0.6) * CFrame.Angles(0, 0, 0.8)
  290. end
  291. bin.Selected:connect(onSelected)
  292. bin.Deselected:connect(onDesel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement