-----------------

ban gui

Sep 13th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.12 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 V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. -- Made by gabkiu1 C: --
  153.  
  154. local plr = game.Players.LocalPlayer
  155. function welcomeOut(we)
  156. we:TweenPosition(UDim2.new(0.5, -120,-2,0), "Out", "Bounce",2)
  157. wait(2)
  158. we.Visible = false
  159. end
  160. local wea = Instance.new("ScreenGui")
  161. wea.Parent = plr.PlayerGui
  162. local Welcome = Instance.new("TextLabel")
  163. Welcome.Parent = wea
  164. Welcome.BackgroundColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  165. Welcome.BorderColor3 = Color3.new(0, 0, 0)
  166. Welcome.BorderSizePixel = 2
  167. Welcome.TextColor3 = Color3.new(255, 255, 255)
  168. Welcome.Text = 'Welcome, Made by "gabkiu1", ENJOY!'
  169. Welcome.TextScaled = true
  170. Welcome.Size = UDim2.new(0, 250, 0, 45)
  171. Welcome.Position = UDim2.new(0.5, -125,0.5,-22)
  172.  
  173. wait(4)
  174. welcomeOut(Welcome)
  175.  
  176. function newgui()
  177. local hasKicked = nil
  178. local plr = game.Players.LocalPlayer
  179. local ScreenGui = Instance.new("ScreenGui")
  180. local Frame = Instance.new("Frame")
  181. local cKick = Instance.new("TextButton")
  182. local victime = Instance.new("TextBox")
  183. local Kicked = Instance.new("TextLabel")
  184. local tReason = Instance.new("TextBox")
  185. local rGui = Instance.new("ScreenGui")
  186. ScreenGui.Parent = plr.PlayerGui
  187.  
  188.  
  189. Frame.Parent = ScreenGui
  190. Frame.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  191. Frame.BorderColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  192. Frame.BorderSizePixel = 2
  193. Frame.Position = UDim2.new(0.915912032, -100, 1, -65)
  194. Frame.Size = UDim2.new(0, 165, 0, 65)
  195.  
  196.  
  197. tReason.Name = "tReason"
  198. tReason.Parent = ScreenGui.Frame
  199. tReason.BackgroundColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  200. tReason.BorderColor3 = Color3.new(0, 0, 0)
  201. tReason.BorderSizePixel = 2
  202. tReason.Position = UDim2.new(0, 0, -0.338461548, 0)
  203. tReason.Size = UDim2.new(0, 165, 0, 20)
  204. tReason.Font = Enum.Font.Fantasy
  205. tReason.PlaceholderColor3 = Color3.new(0.698039, 0.698039, 0.698039)
  206. tReason.Text = "Reason(Optional)"
  207. tReason.TextColor3 = Color3.new(1, 1, 1)
  208. tReason.TextSize = 14
  209.  
  210. cKick.Name = "cKick"
  211. cKick.Parent = Frame
  212. cKick.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  213. cKick.BorderColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  214. cKick.BorderSizePixel = 2
  215. cKick.Position = UDim2.new(0.109090912, 0, 0.55384618, 0)
  216. cKick.Size = UDim2.new(0, 60, 0, 17)
  217. cKick.Font = Enum.Font.Fantasy
  218. cKick.Text = "Kick"
  219. cKick.TextColor3 = Color3.new(1, 1, 1)
  220. cKick.TextSize = 14
  221. local cBan = cKick:Clone()
  222. cBan.Parent = Frame
  223. cBan.Text = "Ban"
  224. cBan.Position = UDim2.new(0.539090912, 0, 0.55384618, 0)
  225.  
  226.  
  227. victime.Name = "victime"
  228. victime.Parent = Frame
  229. victime.BackgroundColor3 = Color3.new(0.917647, 0.917647, 0.917647)
  230. victime.BorderColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  231. victime.BorderSizePixel = 2
  232. victime.Position = UDim2.new(0.0606060624, 0, 0.123076923, 0)
  233. victime.Size = UDim2.new(0, 148, 0, 16)
  234. victime.Font = Enum.Font.Fantasy
  235. victime.PlaceholderColor3 = Color3.new(1, 1, 1)
  236. victime.Text = "Player Name"
  237. victime.TextColor3 = Color3.new(0, 0, 0)
  238. victime.TextScaled = true
  239. victime.TextSize = 14
  240. victime.TextWrapped = true
  241.  
  242. Kicked.Name = "Kicked"
  243. Kicked.Parent = ScreenGui
  244. Kicked.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  245. Kicked.BorderColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  246. Kicked.BorderSizePixel = 2
  247. Kicked.Position = UDim2.new(0.5, -120, 0, 0)
  248. Kicked.Size = UDim2.new(0, 239, 0, 38)
  249. Kicked.Visible = false
  250. Kicked.Font = Enum.Font.Fantasy
  251. Kicked.Text = ""
  252. Kicked.TextColor3 = Color3.new(1, 1, 1)
  253. Kicked.TextScaled = true
  254. Kicked.TextSize = 14
  255. Kicked.TextWrapped = true
  256.  
  257. function plrReason(victim,reason)
  258. local victimReason = Instance.new("TextLabel")
  259. rGui.Parent = victim.PlayerGui
  260. victimReason.Name = "victimReason"
  261. victimReason.Parent = rGui
  262. victimReason.BorderSizePixel = 2
  263. victimReason.BackgroundColor3 = Color3.new(0.109804, 0.109804, 0.109804)
  264. victimReason.BorderColor3 = Color3.new(0.0705882, 0.0705882, 0.0705882)
  265. victimReason.Size = UDim2.new(1,0,1,0)
  266. victimReason.Font = Enum.Font.Fantasy
  267. victimReason.Text = reason
  268. victimReason.TextColor3 = Color3.new(1, 1, 1)
  269. victimReason.TextScaled = true
  270. end
  271.  
  272. function Kick(PLAYER)
  273. if PLAYER.Character and PLAYER.Character:FindFirstChild('HumanoidRootPart') and PLAYER.Character:FindFirstChild('Torso') then
  274. PLAYER.Character.HumanoidRootPart.Position = Vector3.new(math.random(999000, 1001000), 10000, 0)
  275. local Plat = Instance.new('SkateboardPlatform', PLAYER.Character) Plat.Position = PLAYER.Character.HumanoidRootPart.Position
  276. Plat.Name = 'IYkick'
  277. Plat.Size = Vector3.new(100, 1, 100)
  278. local PART = Instance.new('Part', PLAYER.Character)
  279. PART.Position = Plat.Position - Vector3.new(0, 3, 0)
  280. PART.Size = Vector3.new(100, 1, 100)
  281. PART.Anchored = true
  282.  
  283. PART.Transparency = 1
  284. Plat.Transparency = 1
  285.  
  286. repeat wait(1)
  287. if PLAYER.Character and PLAYER.Character:FindFirstChild('HumanoidRootPart') then
  288. Plat.Position = PLAYER.Character.HumanoidRootPart.Position
  289. end
  290. Kick(PLAYER)
  291. until not game.Players:findFirstChild(PLAYER)
  292. end
  293. end
  294.  
  295. function EKick(plrName)
  296. if game.Players:FindFirstChild(plrName) then
  297. if tReason.Text ~= "Reason(Optional)" then
  298. plrReason(game.Players:FindFirstChild(plrName),tReason.Text)
  299. end
  300. wait()
  301. Kick(game.Players:FindFirstChild(plrName))
  302. wait(2.25)
  303.  
  304. if game.Players:FindFirstChild(plrName) then
  305. Kicked.Text = "Something hanpped, ... error..."
  306. Kicked.Visible = true
  307. wait(6)
  308. Kicked.Visible = false
  309. else
  310. Kicked.Text = "Kicked " .. plrName .. " Successful, Made By gabkiu1"
  311. Kicked.Visible = true
  312. wait(6)
  313. Kicked.Visible = false
  314. end
  315. end
  316. end
  317.  
  318. function RKick(plrName)
  319. local plrexist = game.Players:FindFirstChild(plrName)
  320. if not plrexist then
  321. return false
  322. end
  323. if game.Players:FindFirstChild(plrName) then
  324. if tReason.Text ~= "Reason(Optional)" then
  325. plrReason(game.Players:FindFirstChild(plrName),tReason.Text)
  326. end
  327. wait()
  328. Kick(game.Players:FindFirstChild(plrName))
  329. wait(2.25)
  330. if not game.Players:FindFirstChild(plrName) then
  331.  
  332. wait(1)
  333. Kicked.Text = "Kicked " .. plrName .. " Successful, Made By gabkiu1"
  334. Kicked.Visible = true
  335. wait(6)
  336. Kicked.Visible = false
  337. else
  338. Kicked.Text = "Something hanpped... error..."
  339. Kicked.Visible = true
  340. wait(6)
  341. end
  342. end
  343. end
  344. function eBan(plrName)
  345. if game.Players:FindFirstChild(plrName) then
  346. if tReason.Text ~= "Reason(Optional)" then
  347. plrReason(game.Players:FindFirstChild(plrName),tReason.Text)
  348. end
  349. wait()
  350. Kick(game.Players:FindFirstChild(plrName))
  351. wait(2.25)
  352. if game.Players:FindFirstChild(plrName) then
  353. Kicked.Text = "Something hanpped, ... error..."
  354. Kicked.Visible = true
  355. wait(6)
  356. Kicked.Visible = false
  357. end
  358. if not game.Players:FindFirstChild(plrName) then
  359. wait(1)
  360. Kicked.Text = "Banned " .. plrName .. " Successful, Made By gabkiu1"
  361. Kicked.Visible = true
  362. wait(6)
  363. Kicked.Visible = false
  364. while true do
  365. Kick(game.Players:WaitForChild(plrName))
  366. wait(1)
  367. end
  368. end
  369. end
  370. end
  371. function rBan(plrName)
  372. if not game.Players:FindFirstChild(plrName) then
  373. return false
  374. end
  375. if game.Players:FindFirstChild(plrName) then
  376. Kick(game.Players:FindFirstChild(plrName))
  377. wait(2.3)
  378. if game.Players:FindFirstChild(plrName) then
  379. Kicked.Text = "Something hanpped, ... error..."
  380. Kicked.Visible = true
  381. wait(6)
  382. Kicked.Visible = false
  383. end
  384. if not game.Players:FindFirstChild(plrName) then
  385. if tReason.Text ~= "Reason(Optional)" then
  386. plrReason(game.Players:FindFirstChild(plrName),tReason.Text)
  387. end
  388. Kicked.Text = "Banned " .. plrName .. " Successful, Made By gabkiu1"
  389. Kicked.Visible = true
  390. wait(6)
  391. Kicked.Visible = false
  392. while true do
  393. Kick(game.Players:WaitForChild(plrName))
  394. wait(2)
  395. end
  396. end
  397. end
  398. end
  399.  
  400. cBan.MouseButton1Click:connect(function()
  401. if not rBan(victime.Text) then
  402. local letters = string.len(victime.Text)
  403. for i,v in pairs(game.Players:GetChildren()) do
  404. local ple = string.lower(string.sub(v.Name,1,letters))
  405. if ple == string.lower(victime.Text) then
  406. eBan(v.Name)
  407. end
  408. end
  409. end
  410. end)
  411.  
  412. cKick.MouseButton1Click:connect(function()
  413.  
  414. if string.lower(victime.Text) == "all" then
  415. for i,v in pairs(game.Players:GetChildren()) do
  416. if v.Name ~= game.Players.LocalPlayer.Name then
  417. Kick(v)
  418. end
  419. end
  420. elseif string.lower(victime.Text) == "others" then
  421. for i,v in pairs(game.Players:GetChildren()) do
  422. if v.Name ~= game.Players.LocalPlayer.Name then
  423. Kick(v)
  424. end
  425. end
  426. else
  427.  
  428. if not RKick(victime.Text) then
  429. local letters = string.len(victime.Text)
  430. for i,v in pairs(game.Players:GetChildren()) do
  431. local ple = string.lower(string.sub(v.Name,1,letters))
  432. if ple == string.lower(victime.Text) then
  433. EKick(v.Name)
  434. end
  435. end
  436. end
  437. end
  438. end)
  439. end
  440. newgui()
  441. game.Players.LocalPlayer.CharacterAdded:connect(function()
  442. newgui()
  443. end)
Add Comment
Please, Sign In to add comment