Advertisement
rewfsdg3

Untitled

Nov 11th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.79 KB | None | 0 0
  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
  6. print("FE Compatibility code by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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(),Button2Up=fakeEvent(),Button2Down=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 then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132. }
  133. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139.  
  140. player = owner
  141. Char = player.Character
  142. RShoulder = Char.Torso['Right Shoulder']
  143.  
  144. for i, v in pairs(game.Players:GetPlayers()) do
  145. if v.Name == owner.Name then
  146. v.Chatted:connect(function(message)
  147. if message == "BANKAI" then
  148. Player = owner
  149.  
  150.  
  151.  
  152. Tool = Instance.new("HopperBin",Player.Backpack)
  153.  
  154. Tool.Name = "Ichigo's Bankai"
  155.  
  156.  
  157. Handle = Instance.new("Part", Char)
  158.  
  159. Handle.FormFactor = "Custom"
  160.  
  161. Handle.Size = Vector3.new(2, 2, 2.2)
  162.  
  163. Handle.TopSurface = "Smooth"
  164.  
  165. Handle.BottomSurface = "Smooth"
  166.  
  167. Handle.BrickColor = BrickColor.new("Really black")
  168.  
  169. Handle.Reflectance = 0
  170.  
  171. Handle:BreakJoints()
  172.  
  173. Handle.CanCollide = true
  174.  
  175. Mesh = Instance.new("SpecialMesh", Handle)
  176.  
  177. Mesh.MeshId = "http://www.roblox.com/asset/?id=11442510"
  178.  
  179. Mesh.TextureId = "http://www.roblox.com/asset/?id=16018717"
  180.  
  181. Mesh.Scale = Vector3.new(2, 2, 2.2)
  182.  
  183. HandleWeld = Instance.new("Weld", Char)
  184.  
  185. HandleWeld.Part0 = Char["Right Arm"]
  186.  
  187. HandleWeld.Part1 = Handle
  188.  
  189. HandleWeld.C0 = CFrame.new(0, -1, math.rad(-115)) * CFrame.Angles(0, math.rad(180), math.rad(90))
  190.  
  191. DK = Instance.new("Part", Char)
  192.  
  193. DK.FormFactor = "Custom"
  194.  
  195. DK.Size = Vector3.new(1, -1, 1)
  196.  
  197. DK.TopSurface = "Smooth"
  198.  
  199. DK.BottomSurface = "Smooth"
  200.  
  201. DK.BrickColor = BrickColor.new("Really black")
  202.  
  203. DK.Reflectance = 0
  204.  
  205. DK:BreakJoints()
  206.  
  207. DK.CanCollide = false
  208.  
  209. Mesh = Instance.new("SpecialMesh", DK)
  210.  
  211. Mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  212.  
  213. Mesh.Scale = Vector3.new(0.4, 0.25, 0.5)
  214.  
  215. DKWeld = Instance.new("Weld", Char)
  216.  
  217. DKWeld.Part0 = Char["Right Arm"]
  218.  
  219. DKWeld.Part1 = DK
  220.  
  221. DKWeld.C0 = CFrame.new(0, -1, math.rad(50)) * CFrame.Angles(0, math.rad(90), math.rad(90))
  222.  
  223. omg = Instance.new("Part", Char)
  224.  
  225. omg.FormFactor = "Custom"
  226.  
  227. omg.Size = Vector3.new(1, -1, 1)
  228.  
  229. omg.TopSurface = "Smooth"
  230.  
  231. omg.BottomSurface = "Smooth"
  232.  
  233. omg.BrickColor = BrickColor.new("Really black")
  234.  
  235. omg.Reflectance = 0
  236.  
  237. omg:BreakJoints()
  238.  
  239. omg.CanCollide = false
  240.  
  241. Mesh = Instance.new("SpecialMesh", omg)
  242.  
  243. Mesh.MeshId = "http://www.roblox.com/asset/?id=1091939"
  244.  
  245. Mesh.Scale = Vector3.new(1, 1, 1)
  246.  
  247. omgWeld = Instance.new("Weld", Char)
  248.  
  249. omgWeld.Part0 = Char["Right Arm"]
  250.  
  251. omgWeld.Part1 = omg
  252.  
  253. omgWeld.C0 = CFrame.new(0, -1, math.rad(-30)) * CFrame.Angles(0, math.rad(94), math.rad(90))
  254.  
  255. FINAL = Instance.new("Part", Char)
  256.  
  257. FINAL.FormFactor = "Custom"
  258.  
  259. FINAL.Size = Vector3.new(1, -1, 1)
  260.  
  261. FINAL.TopSurface = "Smooth"
  262.  
  263. FINAL.BottomSurface = "Smooth"
  264.  
  265. FINAL.BrickColor = BrickColor.new("Really black")
  266.  
  267. FINAL.Reflectance = 0
  268.  
  269. FINAL:BreakJoints()
  270.  
  271. FINAL.CanCollide = false
  272.  
  273. Mesh = Instance.new("SpecialMesh", FINAL)
  274.  
  275. Mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  276.  
  277. Mesh.Scale = Vector3.new(0.4, 0.25, 0.5)
  278.  
  279. FINALWeld = Instance.new("Weld", Char)
  280.  
  281. FINALWeld.Part0 = Char["Right Arm"]
  282.  
  283. FINALWeld.Part1 = FINAL
  284.  
  285. FINALWeld.C0 = CFrame.new(0, math.rad(-80), math.rad(50)) * CFrame.Angles(0, math.rad(90), math.rad(90))
  286.  
  287. K = Instance.new("Part", Char)
  288.  
  289. K.FormFactor = "Custom"
  290.  
  291. K.Size = Vector3.new(1, -1, 1)
  292.  
  293. K.TopSurface = "Smooth"
  294.  
  295. K.BottomSurface = "Smooth"
  296.  
  297. K.BrickColor = BrickColor.new("Really black")
  298.  
  299. K.Reflectance = 0
  300.  
  301. K:BreakJoints()
  302.  
  303. K.CanCollide = false
  304.  
  305. Mesh = Instance.new("SpecialMesh", K)
  306.  
  307. Mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  308.  
  309. Mesh.Scale = Vector3.new(0.4, 0.25, 0.5)
  310.  
  311. KWeld = Instance.new("Weld", Char)
  312.  
  313. KWeld.Part0 = Char["Right Arm"]
  314.  
  315. KWeld.Part1 = K
  316.  
  317. KWeld.C0 = CFrame.new(0, math.rad(-100), math.rad(50)) * CFrame.Angles(0, math.rad(90), math.rad(90))
  318.  
  319. local Mouse = Player:GetMouse()
  320.  
  321. local Character = Player.Character
  322.  
  323. local Head = Character:findFirstChild("Head")
  324.  
  325. local Torso = Character:findFirstChild("Torso")
  326.  
  327. local RightArm = Character:findFirstChild("Right Arm")
  328.  
  329. local RightSH = Torso:findFirstChild("Right Shoulder")
  330.  
  331. local LeftArm = Character:findFirstChild("Left Arm")
  332.  
  333. local LeftSH = Torso:findFirstChild("Left Shoulder")
  334.  
  335. local Joint1
  336.  
  337. local Joint2
  338.  
  339. Handle.Touched:connect(function(hit)
  340. if hit.Parent:FindFirstChild("Humanoid") then
  341. hit.Parent:FindFirstChild("Humanoid"):TakeDamage(25)
  342. end
  343. end)
  344. end
  345. end)
  346. end
  347. end
  348.  
  349. print ("Bankai Has Lodaed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement