Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Gui to Lua
- -- Version: 3
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility by timlikekezenit")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- -- Instances:
- local Kick = Instance.new("ScreenGui")
- local Error = Instance.new("TextLabel")
- local drag = Instance.new("TextButton")
- local Frame = Instance.new("Frame")
- local Kickbutton = Instance.new("TextButton")
- local Kickreason = Instance.new("TextBox")
- local Playername = Instance.new("TextBox")
- local TextButton = Instance.new("TextButton")
- local Title = Instance.new("TextLabel")
- local ScreenGui = Instance.new("ScreenGui")
- local Topbar = Instance.new("Frame")
- --Properties:
- Kick.Name = "Kick"
- Kick.Parent = owner:WaitForChild("PlayerGui")
- Kick.DisplayOrder = 999999999
- Error.Name = "Error"
- Error.Parent = Kick
- Error.BackgroundColor3 = Color3.new(0, 1, 0.364706)
- Error.BorderSizePixel = 0
- Error.Position = UDim2.new(0, 0, 0.5, 0)
- Error.Size = UDim2.new(1, 0, 0, 47)
- Error.Visible = false
- Error.ZIndex = 999999999
- Error.Font = Enum.Font.SourceSans
- Error.Text = ""
- Error.TextColor3 = Color3.new(0, 0, 0)
- Error.TextScaled = true
- Error.TextSize = 14
- Error.TextWrapped = true
- drag.Name = "drag"
- drag.Parent = Kick
- drag.BackgroundColor3 = Color3.new(1, 1, 1)
- drag.BackgroundTransparency = 1
- drag.Position = UDim2.new(0.5, 0, 0.5, 0)
- drag.Size = UDim2.new(0, 174, 0, 41)
- drag.ZIndex = 999999999
- drag.Font = Enum.Font.SourceSans
- drag.Text = ""
- drag.TextColor3 = Color3.new(0, 0, 0)
- drag.TextSize = 14
- drag.TextWrapped = true
- Frame.Parent = drag
- Frame.BackgroundColor3 = Color3.new(0.223529, 0.223529, 0.223529)
- Frame.BorderSizePixel = 0
- Frame.LayoutOrder = -1
- Frame.Position = UDim2.new(-0.0454206094, 0, -0.229268283, 0)
- Frame.Size = UDim2.new(0, 244, 0, 282)
- Frame.ZIndex = 0
- Kickbutton.Name = "Kickbutton"
- Kickbutton.Parent = Frame
- Kickbutton.BackgroundColor3 = Color3.new(0, 1, 0.364706)
- Kickbutton.BorderSizePixel = 0
- Kickbutton.Position = UDim2.new(0.0305000674, 0, 0.290291756, 0)
- Kickbutton.Size = UDim2.new(0, 230, 0, 48)
- Kickbutton.Font = Enum.Font.SourceSans
- Kickbutton.Text = "Kick"
- Kickbutton.TextColor3 = Color3.new(0, 0, 0)
- Kickbutton.TextScaled = true
- Kickbutton.TextSize = 14
- Kickbutton.TextWrapped = true
- Kickreason.Name = "Kickreason"
- Kickreason.Parent = Frame
- Kickreason.BackgroundColor3 = Color3.new(0, 1, 0.364706)
- Kickreason.BorderSizePixel = 0
- Kickreason.Position = UDim2.new(0.0305000674, 0, 0.508234978, 0)
- Kickreason.Size = UDim2.new(0, 230, 0, 57)
- Kickreason.Font = Enum.Font.SourceSans
- Kickreason.PlaceholderColor3 = Color3.new(0.301961, 0.301961, 0.301961)
- Kickreason.PlaceholderText = "Enter Reason"
- Kickreason.Text = ""
- Kickreason.TextColor3 = Color3.new(0, 0, 0)
- Kickreason.TextScaled = true
- Kickreason.TextSize = 14
- Kickreason.TextWrapped = true
- Playername.Name = "Playername"
- Playername.Parent = Frame
- Playername.BackgroundColor3 = Color3.new(0, 1, 0.364706)
- Playername.BorderSizePixel = 0
- Playername.Position = UDim2.new(0.0305000674, 0, 0.746438861, 0)
- Playername.Size = UDim2.new(0, 230, 0, 57)
- Playername.Font = Enum.Font.SourceSans
- Playername.PlaceholderColor3 = Color3.new(0.301961, 0.301961, 0.301961)
- Playername.PlaceholderText = "Enter target name"
- Playername.Text = ""
- Playername.TextColor3 = Color3.new(0, 0, 0)
- Playername.TextScaled = true
- Playername.TextSize = 14
- Playername.TextWrapped = true
- TextButton.Parent = Frame
- TextButton.BackgroundColor3 = Color3.new(0, 1, 0.364706)
- TextButton.BorderSizePixel = 0
- TextButton.Position = UDim2.new(0.783174813, 0, 0.0302564874, 0)
- TextButton.Size = UDim2.new(0, 46, 0, 45)
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "X"
- TextButton.TextColor3 = Color3.new(0, 0, 0)
- TextButton.TextScaled = true
- TextButton.TextSize = 14
- TextButton.TextWrapped = true
- Title.Name = "Title"
- Title.Parent = Frame
- Title.BackgroundColor3 = Color3.new(0, 1, 0.364706)
- Title.BorderSizePixel = 0
- Title.Position = UDim2.new(0.0305000674, 0, 0.0292614885, 0)
- Title.Size = UDim2.new(0, 176, 0, 45)
- Title.Font = Enum.Font.SourceSans
- Title.Text = "Kick GUI"
- Title.TextColor3 = Color3.new(0, 0, 0)
- Title.TextScaled = true
- Title.TextSize = 14
- Title.TextWrapped = true
- ScreenGui.Parent = Kick
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Topbar.Name = "Topbar"
- Topbar.Parent = ScreenGui
- Topbar.BackgroundColor3 = Color3.new(0, 0, 0)
- Topbar.BackgroundTransparency = 0.60000002384186
- Topbar.BorderSizePixel = 0
- Topbar.Position = UDim2.new(0, 0, 0, -100)
- Topbar.Size = UDim2.new(0, 1000000, 0, 100)
- Topbar.ZIndex = 999999998
- -- Scripts:
- local function INPMF_fake_script() -- drag.LocalScript
- local script = Instance.new('LocalScript', drag)
- local UserInputService = game:GetService("UserInputService")
- local gui = script.Parent
- local dragging
- local dragInput
- local dragStart
- local startPos
- local function update(input)
- local delta = input.Position - dragStart
- gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- gui.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = gui.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- gui.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- end
- coroutine.wrap(INPMF_fake_script)()
- local function SGSD_fake_script() -- Frame.KickScript
- local script = Instance.new('LocalScript', Frame)
- local window = script.Parent
- local kickbutton = window.Kickbutton
- local plrname = window.Playername
- local reason = window.Kickreason
- local Err = window.Parent.Parent.Error
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local kickPlayerEvent = ReplicatedStorage:WaitForChild("KickPlayer")
- kickbutton.MouseButton1Click:Connect(function()
- local playerToKick = game.Players:FindFirstChild(plrname.Text)
- if playerToKick then
- kickPlayerEvent:FireServer(reason.Text)
- elseif plrname.Text:sub(1,1)=="" or plrname.Text:sub(1,1)==" " then
- Err.Text = 'Error while trying to find user "'.. plrname.Text ..'".'
- Err.Visible = true
- wait(3)
- Err.Visible = false
- Err.Text = ""
- elseif not playerToKick then
- Err.Text = 'Player "'..plrname.Text..'" does not exist! Make sure you are typing in their name with correct caps and spelling.'
- Err.Visible = true
- wait(3)
- Err.Visible = false
- Err.Text = ""
- end
- end)
- end
- coroutine.wrap(SGSD_fake_script)()
- local function ABNG_fake_script() -- TextButton.LocalScript
- local script = Instance.new('LocalScript', TextButton)
- script.Parent.MouseButton1Click:connect(function()
- script.Parent.Parent:Destroy()
- end)
- end
- coroutine.wrap(ABNG_fake_script)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement