Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Gui to Lua
- -- Version: 3.2
- -- Instances:
- fileditor = Instance.new("ScreenGui")
- editor = Instance.new("Frame")
- Title = Instance.new("TextLabel")
- content = Instance.new("TextBox")
- X = Instance.new("TextButton")
- down = Instance.new("Frame")
- save = Instance.new("TextButton")
- execute = Instance.new("TextButton")
- Clear = Instance.new("TextButton")
- Choose = Instance.new("Frame")
- YesNo = Instance.new("Frame")
- Title_2 = Instance.new("TextLabel")
- No = Instance.new("TextButton")
- Yes = Instance.new("TextButton")
- X_2 = Instance.new("TextButton")
- textbox = Instance.new("Frame")
- Title_3 = Instance.new("TextLabel")
- name = Instance.new("TextBox")
- OK = Instance.new("TextButton")
- X_3 = Instance.new("TextButton")
- Minimize = Instance.new("TextButton")
- --Properties:
- fileditor.Name = "fileditor"
- fileditor.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- fileditor.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- fileditor.ResetOnSpawn = false
- editor.Name = "editor"
- editor.Parent = fileditor
- editor.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- editor.BorderColor3 = Color3.fromRGB(0, 200, 0)
- editor.BorderSizePixel = 2
- editor.Position = UDim2.new(0.20198676, 0, 0.0936599448, 0)
- editor.Size = UDim2.new(0, 700, 0, 30)
- Title.Name = "Title"
- Title.Parent = editor
- Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Title.BackgroundTransparency = 1.000
- Title.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Title.BorderSizePixel = 0
- Title.Size = UDim2.new(0.122857146, 0, 1, 0)
- Title.Font = Enum.Font.Arial
- Title.Text = " File Editor"
- Title.TextColor3 = Color3.fromRGB(0, 200, 0)
- Title.TextSize = 14.000
- Title.TextXAlignment = Enum.TextXAlignment.Left
- content.Name = "content"
- content.Parent = editor
- content.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- content.BorderColor3 = Color3.fromRGB(0, 200, 0)
- content.BorderSizePixel = 2
- content.Position = UDim2.new(0, 0, 0, 30)
- content.Size = UDim2.new(0, 700, 0, 270)
- content.ClearTextOnFocus = false
- content.Font = Enum.Font.SourceSans
- content.MultiLine = true
- content.PlaceholderColor3 = Color3.fromRGB(0, 100, 0)
- content.PlaceholderText = "Type here any content of file you need."
- content.Text = ""
- content.TextColor3 = Color3.fromRGB(0, 200, 0)
- content.TextSize = 14.000
- content.TextXAlignment = Enum.TextXAlignment.Left
- content.TextYAlignment = Enum.TextYAlignment.Top
- X.Name = "X"
- X.Parent = editor
- X.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- X.BorderColor3 = Color3.fromRGB(0, 200, 0)
- X.BorderSizePixel = 2
- X.Position = UDim2.new(0, 673, 0, 0)
- X.Size = UDim2.new(0, 27, 0, 27)
- X.Font = Enum.Font.SourceSans
- X.Text = "X"
- X.TextColor3 = Color3.fromRGB(0, 200, 0)
- X.TextScaled = true
- X.TextSize = 14.000
- X.TextWrapped = true
- down.Name = "down"
- down.Parent = editor
- down.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- down.BorderColor3 = Color3.fromRGB(0, 200, 0)
- down.BorderSizePixel = 2
- down.Position = UDim2.new(0, 0, 0, 300)
- down.Size = UDim2.new(0, 700, 0, 30)
- down.ZIndex = 5
- Minimize.Name = "Minimize"
- Minimize.Parent = fileditor
- Minimize.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
- Minimize.BackgroundTransparency = 0.500
- Minimize.BorderSizePixel = 0
- Minimize.Position = UDim2.new(0.6, 0, 0.2, 0)
- Minimize.Size = UDim2.new(0, 100, 0, 100)
- Minimize.Visible = false
- Minimize.AutoButtonColor = false
- Minimize.Font = Enum.Font.Arial
- Minimize.Text = "+"
- Minimize.TextColor3 = Color3.fromRGB(0, 0, 0)
- Minimize.TextScaled = true
- Minimize.TextSize = 14
- save.Name = "save"
- save.Parent = down
- save.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- save.BorderColor3 = Color3.fromRGB(0, 200, 0)
- save.BorderSizePixel = 2
- save.Position = UDim2.new(0, 580, 0, 0)
- save.Size = UDim2.new(0, 120, 0, 30)
- save.Font = Enum.Font.SourceSans
- save.Text = "Save as File"
- save.TextColor3 = Color3.fromRGB(0, 200, 0)
- save.TextSize = 24.000
- save.TextWrapped = true
- execute.Name = "execute"
- execute.Parent = down
- execute.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- execute.BorderColor3 = Color3.fromRGB(0, 200, 0)
- execute.BorderSizePixel = 2
- execute.Size = UDim2.new(0, 120, 0, 30)
- execute.Font = Enum.Font.SourceSans
- execute.Text = "Execute"
- execute.TextColor3 = Color3.fromRGB(0, 200, 0)
- execute.TextSize = 24.000
- execute.TextWrapped = true
- Clear.Name = "Clear"
- Clear.Parent = down
- Clear.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Clear.BorderColor3 = Color3.fromRGB(0, 200, 0)
- Clear.BorderSizePixel = 2
- Clear.Position = UDim2.new(0.171428576, 0, 0, 0)
- Clear.Size = UDim2.new(0, 120, 0, 30)
- Clear.Font = Enum.Font.SourceSans
- Clear.Text = "Clear"
- Clear.TextColor3 = Color3.fromRGB(0, 200, 0)
- Clear.TextSize = 24.000
- Clear.TextWrapped = true
- Choose.Name = "Choose"
- Choose.Parent = fileditor
- Choose.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Choose.BackgroundTransparency = 0.500
- Choose.BorderColor3 = Color3.fromRGB(0, 0, 0)
- Choose.BorderSizePixel = 0
- Choose.Size = UDim2.new(1, 0, 1, 0)
- Choose.Visible = false
- Choose.ZIndex = 50
- YesNo.Name = "YesNo"
- YesNo.Parent = Choose
- YesNo.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- YesNo.BorderColor3 = Color3.fromRGB(0, 200, 0)
- YesNo.BorderSizePixel = 2
- YesNo.Position = UDim2.new(0.5, -150, 0.5, -70)
- YesNo.Size = UDim2.new(0, 300, 0, 140)
- YesNo.Visible = false
- YesNo.ZIndex = 5
- Title_2.Name = "Title"
- Title_2.Parent = YesNo
- Title_2.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Title_2.BorderColor3 = Color3.fromRGB(0, 200, 0)
- Title_2.BorderSizePixel = 2
- Title_2.Position = UDim2.new(-0.00333333341, 0, 0, 0)
- Title_2.Size = UDim2.new(1, 0, 0, 24)
- Title_2.Font = Enum.Font.Arial
- Title_2.Text = " Are you sure?"
- Title_2.TextColor3 = Color3.fromRGB(0, 200, 0)
- Title_2.TextSize = 18.000
- Title_2.TextXAlignment = Enum.TextXAlignment.Left
- No.Name = "No"
- No.Parent = YesNo
- No.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- No.BorderColor3 = Color3.fromRGB(0, 200, 0)
- No.BorderSizePixel = 2
- No.Position = UDim2.new(0.591666639, 0, 0.4738096, 0)
- No.Size = UDim2.new(0, 50, 0, 24)
- No.Font = Enum.Font.SourceSans
- No.Text = "No"
- No.TextColor3 = Color3.fromRGB(0, 200, 0)
- No.TextSize = 18.000
- No.TextWrapped = true
- Yes.Name = "Yes"
- Yes.Parent = YesNo
- Yes.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Yes.BorderColor3 = Color3.fromRGB(0, 200, 0)
- Yes.BorderSizePixel = 2
- Yes.Position = UDim2.new(0.24166666, 0, 0.4738096, 0)
- Yes.Size = UDim2.new(0, 50, 0, 24)
- Yes.Font = Enum.Font.SourceSans
- Yes.Text = "Yes"
- Yes.TextColor3 = Color3.fromRGB(0, 200, 0)
- Yes.TextSize = 18.000
- Yes.TextWrapped = true
- X_2.Name = "X"
- X_2.Parent = YesNo
- X_2.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- X_2.BorderColor3 = Color3.fromRGB(0, 200, 0)
- X_2.BorderSizePixel = 2
- X_2.Position = UDim2.new(0, 276, 0, 0)
- X_2.Size = UDim2.new(0, 24, 0, 24)
- X_2.Font = Enum.Font.SourceSans
- X_2.Text = "X"
- X_2.TextColor3 = Color3.fromRGB(0, 200, 0)
- X_2.TextScaled = true
- X_2.TextSize = 14.000
- X_2.TextWrapped = true
- textbox.Name = "textbox"
- textbox.Parent = Choose
- textbox.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- textbox.BorderColor3 = Color3.fromRGB(0, 200, 0)
- textbox.BorderSizePixel = 2
- textbox.Position = UDim2.new(0.5, -120, 0.5, -90)
- textbox.Size = UDim2.new(0, 240, 0, 180)
- textbox.ZIndex = 5
- Title_3.Name = "Title"
- Title_3.Parent = textbox
- Title_3.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Title_3.BorderColor3 = Color3.fromRGB(0, 200, 0)
- Title_3.BorderSizePixel = 2
- Title_3.Size = UDim2.new(1, 0, 0, 24)
- Title_3.Font = Enum.Font.Arial
- Title_3.Text = " Type here a file name"
- Title_3.TextColor3 = Color3.fromRGB(0, 200, 0)
- Title_3.TextSize = 18.000
- Title_3.TextXAlignment = Enum.TextXAlignment.Left
- name.Name = "name"
- name.Parent = textbox
- name.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- name.BorderColor3 = Color3.fromRGB(0, 200, 0)
- name.BorderSizePixel = 2
- name.Position = UDim2.new(-0.416666657, 110, 0.50555557, 0)
- name.Size = UDim2.new(0, 220, 0, 24)
- name.Font = Enum.Font.Arial
- name.PlaceholderColor3 = Color3.fromRGB(0, 100, 0)
- name.PlaceholderText = "Text here"
- name.Text = ""
- name.TextColor3 = Color3.fromRGB(0, 200, 0)
- name.TextSize = 14.000
- OK.Name = "OK"
- OK.Parent = textbox
- OK.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- OK.BorderColor3 = Color3.fromRGB(0, 200, 0)
- OK.BorderSizePixel = 2
- OK.Position = UDim2.new(0.791666687, 0, 0.866666675, 0)
- OK.Size = UDim2.new(0, 50, 0, 24)
- OK.Font = Enum.Font.SourceSans
- OK.Text = "OK"
- OK.TextColor3 = Color3.fromRGB(0, 200, 0)
- OK.TextSize = 18.000
- OK.TextWrapped = true
- X_3.Name = "X"
- X_3.Parent = textbox
- X_3.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- X_3.BorderColor3 = Color3.fromRGB(0, 200, 0)
- X_3.BorderSizePixel = 2
- X_3.Position = UDim2.new(0, 216, 0, 0)
- X_3.Size = UDim2.new(0, 24, 0, 24)
- X_3.Font = Enum.Font.SourceSans
- X_3.Text = "X"
- X_3.TextColor3 = Color3.fromRGB(0, 200, 0)
- X_3.TextScaled = true
- X_3.TextSize = 14.000
- X_3.TextWrapped = true
- X.MouseButton1Click:Connect(function()
- editor.Visible = false
- Minimize.Visible = true
- end)
- Minimize.MouseButton1Click:Connect(function()
- editor.Visible = true
- Minimize.Visible = false
- end)
- local UserInputService = game:GetService("UserInputService")
- local gui = Minimize
- 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
- game:GetService("GuiService").TouchControlsEnabled = true
- dragging = false
- end
- end)
- end
- end)
- gui.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- game:GetService("GuiService").TouchControlsEnabled = false
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- local gui = editor
- 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
- game:GetService("GuiService").TouchControlsEnabled = true
- dragging = false
- end
- end)
- end
- end)
- gui.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- game:GetService("GuiService").TouchControlsEnabled = false
- dragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- local function savefile()
- Choose.Visible=true
- name.Text = ""
- YesNo.Visible = false
- textbox.Visible = true
- OK.MouseButton1Click:Connect(function()
- if name.Text == "" then
- warn("No file name!")
- else
- textbox.Visible = false
- YesNo.Visible = true
- end
- end)
- end
- X_2.MouseButton1Click:Connect(function()
- Choose.Visible = false
- end)
- X_3.MouseButton1Click:Connect(function()
- Choose.Visible = false
- end)
- save.MouseButton1Click:Connect(savefile)
- Yes.MouseButton1Click:Connect(function()
- writefile(name.Text, content.Text)
- Choose.Visible = false
- end)
- No.MouseButton1Click:Connect(function()
- Choose.Visible = false
- end)
- execute.MouseButton1Click:Connect(function()
- loadstring(content.Text)()
- end)
- Clear.MouseButton1Click:Connect(function()
- content.Text = ""
- end)
Advertisement
Add Comment
Please, Sign In to add comment