Advertisement
thatonepuggo

Kick menu [ROBLOX FE]

Dec 17th, 2019
24,907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.88 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3
  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 by timlikekezenit")
  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 = game:GetService("Players").LocalPlayer
  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 Mouse = Player:GetMouse()
  75.     local h,t
  76.     --Give the server mouse data 30 times every second, but only if the values changed
  77.     --If player is not moving their mouse, client won't fire events
  78.     while wait(1/30) do
  79.         if h~=Mouse.Hit or t~=Mouse.Target then
  80.             h,t=Mouse.Hit,Mouse.Target
  81.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  82.         end
  83.     end]==],Player.Character)
  84.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. -- Instances:
  88.  
  89. local Kick = Instance.new("ScreenGui")
  90. local Error = Instance.new("TextLabel")
  91. local drag = Instance.new("TextButton")
  92. local Frame = Instance.new("Frame")
  93. local Kickbutton = Instance.new("TextButton")
  94. local Kickreason = Instance.new("TextBox")
  95. local Playername = Instance.new("TextBox")
  96. local TextButton = Instance.new("TextButton")
  97. local Title = Instance.new("TextLabel")
  98. local ScreenGui = Instance.new("ScreenGui")
  99. local Topbar = Instance.new("Frame")
  100.  
  101. --Properties:
  102.  
  103. Kick.Name = "Kick"
  104. Kick.Parent = owner:WaitForChild("PlayerGui")
  105. Kick.DisplayOrder = 999999999
  106.  
  107. Error.Name = "Error"
  108. Error.Parent = Kick
  109. Error.BackgroundColor3 = Color3.new(0, 1, 0.364706)
  110. Error.BorderSizePixel = 0
  111. Error.Position = UDim2.new(0, 0, 0.5, 0)
  112. Error.Size = UDim2.new(1, 0, 0, 47)
  113. Error.Visible = false
  114. Error.ZIndex = 999999999
  115. Error.Font = Enum.Font.SourceSans
  116. Error.Text = ""
  117. Error.TextColor3 = Color3.new(0, 0, 0)
  118. Error.TextScaled = true
  119. Error.TextSize = 14
  120. Error.TextWrapped = true
  121.  
  122. drag.Name = "drag"
  123. drag.Parent = Kick
  124. drag.BackgroundColor3 = Color3.new(1, 1, 1)
  125. drag.BackgroundTransparency = 1
  126. drag.Position = UDim2.new(0.5, 0, 0.5, 0)
  127. drag.Size = UDim2.new(0, 174, 0, 41)
  128. drag.ZIndex = 999999999
  129. drag.Font = Enum.Font.SourceSans
  130. drag.Text = ""
  131. drag.TextColor3 = Color3.new(0, 0, 0)
  132. drag.TextSize = 14
  133. drag.TextWrapped = true
  134.  
  135. Frame.Parent = drag
  136. Frame.BackgroundColor3 = Color3.new(0.223529, 0.223529, 0.223529)
  137. Frame.BorderSizePixel = 0
  138. Frame.LayoutOrder = -1
  139. Frame.Position = UDim2.new(-0.0454206094, 0, -0.229268283, 0)
  140. Frame.Size = UDim2.new(0, 244, 0, 282)
  141. Frame.ZIndex = 0
  142.  
  143. Kickbutton.Name = "Kickbutton"
  144. Kickbutton.Parent = Frame
  145. Kickbutton.BackgroundColor3 = Color3.new(0, 1, 0.364706)
  146. Kickbutton.BorderSizePixel = 0
  147. Kickbutton.Position = UDim2.new(0.0305000674, 0, 0.290291756, 0)
  148. Kickbutton.Size = UDim2.new(0, 230, 0, 48)
  149. Kickbutton.Font = Enum.Font.SourceSans
  150. Kickbutton.Text = "Kick"
  151. Kickbutton.TextColor3 = Color3.new(0, 0, 0)
  152. Kickbutton.TextScaled = true
  153. Kickbutton.TextSize = 14
  154. Kickbutton.TextWrapped = true
  155.  
  156. Kickreason.Name = "Kickreason"
  157. Kickreason.Parent = Frame
  158. Kickreason.BackgroundColor3 = Color3.new(0, 1, 0.364706)
  159. Kickreason.BorderSizePixel = 0
  160. Kickreason.Position = UDim2.new(0.0305000674, 0, 0.508234978, 0)
  161. Kickreason.Size = UDim2.new(0, 230, 0, 57)
  162. Kickreason.Font = Enum.Font.SourceSans
  163. Kickreason.PlaceholderColor3 = Color3.new(0.301961, 0.301961, 0.301961)
  164. Kickreason.PlaceholderText = "Enter Reason"
  165. Kickreason.Text = ""
  166. Kickreason.TextColor3 = Color3.new(0, 0, 0)
  167. Kickreason.TextScaled = true
  168. Kickreason.TextSize = 14
  169. Kickreason.TextWrapped = true
  170.  
  171. Playername.Name = "Playername"
  172. Playername.Parent = Frame
  173. Playername.BackgroundColor3 = Color3.new(0, 1, 0.364706)
  174. Playername.BorderSizePixel = 0
  175. Playername.Position = UDim2.new(0.0305000674, 0, 0.746438861, 0)
  176. Playername.Size = UDim2.new(0, 230, 0, 57)
  177. Playername.Font = Enum.Font.SourceSans
  178. Playername.PlaceholderColor3 = Color3.new(0.301961, 0.301961, 0.301961)
  179. Playername.PlaceholderText = "Enter target name"
  180. Playername.Text = ""
  181. Playername.TextColor3 = Color3.new(0, 0, 0)
  182. Playername.TextScaled = true
  183. Playername.TextSize = 14
  184. Playername.TextWrapped = true
  185.  
  186. TextButton.Parent = Frame
  187. TextButton.BackgroundColor3 = Color3.new(0, 1, 0.364706)
  188. TextButton.BorderSizePixel = 0
  189. TextButton.Position = UDim2.new(0.783174813, 0, 0.0302564874, 0)
  190. TextButton.Size = UDim2.new(0, 46, 0, 45)
  191. TextButton.Font = Enum.Font.SourceSans
  192. TextButton.Text = "X"
  193. TextButton.TextColor3 = Color3.new(0, 0, 0)
  194. TextButton.TextScaled = true
  195. TextButton.TextSize = 14
  196. TextButton.TextWrapped = true
  197.  
  198. Title.Name = "Title"
  199. Title.Parent = Frame
  200. Title.BackgroundColor3 = Color3.new(0, 1, 0.364706)
  201. Title.BorderSizePixel = 0
  202. Title.Position = UDim2.new(0.0305000674, 0, 0.0292614885, 0)
  203. Title.Size = UDim2.new(0, 176, 0, 45)
  204. Title.Font = Enum.Font.SourceSans
  205. Title.Text = "Kick GUI"
  206. Title.TextColor3 = Color3.new(0, 0, 0)
  207. Title.TextScaled = true
  208. Title.TextSize = 14
  209. Title.TextWrapped = true
  210.  
  211. ScreenGui.Parent = Kick
  212. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  213.  
  214. Topbar.Name = "Topbar"
  215. Topbar.Parent = ScreenGui
  216. Topbar.BackgroundColor3 = Color3.new(0, 0, 0)
  217. Topbar.BackgroundTransparency = 0.60000002384186
  218. Topbar.BorderSizePixel = 0
  219. Topbar.Position = UDim2.new(0, 0, 0, -100)
  220. Topbar.Size = UDim2.new(0, 1000000, 0, 100)
  221. Topbar.ZIndex = 999999998
  222.  
  223. -- Scripts:
  224.  
  225. local function INPMF_fake_script() -- drag.LocalScript
  226.     local script = Instance.new('LocalScript', drag)
  227.  
  228.     local UserInputService = game:GetService("UserInputService")
  229.    
  230.     local gui = script.Parent
  231.    
  232.     local dragging
  233.     local dragInput
  234.     local dragStart
  235.     local startPos
  236.    
  237.     local function update(input)
  238.         local delta = input.Position - dragStart
  239.         gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  240.     end
  241.    
  242.     gui.InputBegan:Connect(function(input)
  243.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  244.             dragging = true
  245.             dragStart = input.Position
  246.             startPos = gui.Position
  247.            
  248.             input.Changed:Connect(function()
  249.                 if input.UserInputState == Enum.UserInputState.End then
  250.                     dragging = false
  251.                 end
  252.             end)
  253.         end
  254.     end)
  255.    
  256.     gui.InputChanged:Connect(function(input)
  257.         if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  258.             dragInput = input
  259.         end
  260.     end)
  261.    
  262.     UserInputService.InputChanged:Connect(function(input)
  263.         if input == dragInput and dragging then
  264.             update(input)
  265.         end
  266.     end)
  267. end
  268. coroutine.wrap(INPMF_fake_script)()
  269. local function SGSD_fake_script() -- Frame.KickScript
  270.     local script = Instance.new('LocalScript', Frame)
  271.  
  272.     local window = script.Parent
  273.     local kickbutton = window.Kickbutton
  274.     local plrname = window.Playername
  275.     local reason = window.Kickreason
  276.     local Err = window.Parent.Parent.Error
  277.     local ReplicatedStorage = game:GetService("ReplicatedStorage")
  278.     local kickPlayerEvent = ReplicatedStorage:WaitForChild("KickPlayer")
  279.      
  280.     kickbutton.MouseButton1Click:Connect(function()
  281.         local playerToKick = game.Players:FindFirstChild(plrname.Text)
  282.         if  playerToKick then
  283.             kickPlayerEvent:FireServer(reason.Text)
  284.         elseif plrname.Text:sub(1,1)=="" or plrname.Text:sub(1,1)==" " then
  285.             Err.Text = 'Error while trying to find user "'.. plrname.Text ..'".'
  286.             Err.Visible = true
  287.             wait(3)
  288.             Err.Visible = false
  289.             Err.Text = ""
  290.         elseif not playerToKick then
  291.             Err.Text = 'Player "'..plrname.Text..'" does not exist! Make sure you are typing in their name with correct caps and spelling.'
  292.             Err.Visible = true
  293.             wait(3)
  294.             Err.Visible = false
  295.             Err.Text = ""
  296.         end
  297.     end)
  298. end
  299. coroutine.wrap(SGSD_fake_script)()
  300. local function ABNG_fake_script() -- TextButton.LocalScript
  301.     local script = Instance.new('LocalScript', TextButton)
  302.  
  303.     script.Parent.MouseButton1Click:connect(function()
  304.             script.Parent.Parent:Destroy()
  305.     end)
  306. end
  307. coroutine.wrap(ABNG_fake_script)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement