0% found this document useful (0 votes)
45 views7 pages

Roblox GUI Script for Smooth Dragging

The document describes a Lua script for a Roblox GUI named 'Krypton', which allows users to create and execute scripts with a smooth drag-and-drop interface. It includes features such as a script editor, buttons for executing and clearing scripts, and a panel for managing remote events and functions. The script also implements visual feedback for selected remotes and supports executing commands either locally or through remote events/functions.

Uploaded by

zarcyuva
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views7 pages

Roblox GUI Script for Smooth Dragging

The document describes a Lua script for a Roblox GUI named 'Krypton', which allows users to create and execute scripts with a smooth drag-and-drop interface. It includes features such as a script editor, buttons for executing and clearing scripts, and a panel for managing remote events and functions. The script also implements visual feedback for selected remotes and supports executing commands either locally or through remote events/functions.

Uploaded by

zarcyuva
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

player = [Link].

LocalPlayer
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local screenGui = [Link]("ScreenGui")


[Link] = "KryptonGui"
[Link] = false
[Link] = player:WaitForChild("PlayerGui")

-----------------------------------------------------------------
-- SMOOTH DRAG
-----------------------------------------------------------------
local UserInputService_upvr = game:GetService("UserInputService")
function dragify(frame)
local dragToggle, dragInput, dragStart, startPos

local function updateInput(input)


local delta = [Link] - dragStart
TweenService:Create(frame, [Link](0.25), {
Position = [Link]([Link], [Link] + delta.X,
[Link], [Link] + delta.Y)
}):Play()
end

[Link]:Connect(function(input)
if [Link] == [Link].MouseButton1
or [Link] == [Link] then

if UserInputService_upvr:GetFocusedTextBox() == nil then


dragToggle = true
dragStart = [Link]
startPos = [Link]

[Link]:Connect(function()
if [Link] == [Link] then
dragToggle = false
end
end)
end
end
end)

[Link]:Connect(function(input)
if [Link] == [Link]
or [Link] == [Link] then
dragInput = input
end
end)

UserInputService_upvr.InputChanged:Connect(function(input)
if input == dragInput and dragToggle then
updateInput(input)
end
end)
end

-----------------------------------------------------------------
-- MAIN EDITOR WINDOW
-----------------------------------------------------------------
local mainFrame = [Link]("Frame")
[Link] = [Link](0.32, 0, 0.45, 0)
[Link] = [Link](0.35, 0, 0.25, 0)
mainFrame.BackgroundColor3 = [Link](35, 0, 50)
[Link] = screenGui

local topBar = [Link]("Frame")


[Link] = [Link](1, 0, 0.1, 0)
topBar.BackgroundColor3 = [Link](25, 0, 40)
[Link] = mainFrame

dragify(mainFrame)

local topBarLabel = [Link]("TextLabel")


[Link] = [Link](1, 0, 1, 0)
[Link] = "Krypton"
topBarLabel.TextColor3 = [Link](255, 255, 255)
[Link] = 1
[Link] = [Link]
[Link] = topBar

local scriptEditor = [Link]("TextBox")


[Link] = [Link](1, -20, 0.7, -10)
[Link] = [Link](0, 10, 0.1, 10)
[Link] = true
[Link] = 'print("Hello World!")'
[Link] = [Link]
[Link] = [Link]
scriptEditor.TextColor3 = [Link](255, 255, 255)
scriptEditor.BackgroundColor3 = [Link](25, 0, 40)
[Link] = false
[Link] = mainFrame

local executeButton = [Link]("TextButton")


[Link] = [Link](0.3, 0, 0.1, 0)
[Link] = [Link](0.05, 0, 0.85, 0)
[Link] = "Execute"
[Link] = [Link]
executeButton.TextColor3 = [Link](255, 255, 255)
executeButton.BackgroundColor3 = [Link](25, 0, 40)
[Link] = mainFrame

local clearButton = [Link]("TextButton")


[Link] = [Link](0.3, 0, 0.1, 0)
[Link] = [Link](0.35, 0, 0.85, 0)
[Link] = "Clear"
[Link] = [Link]
clearButton.TextColor3 = [Link](255, 255, 255)
clearButton.BackgroundColor3 = [Link](25, 0, 40)
[Link] = mainFrame

local moreButton = [Link]("TextButton")


[Link] = [Link](0.2, 0, 0.1, 0)
[Link] = [Link](0.66, 0, 0.85, 0)
[Link] = "<" -- Changed to left arrow for "select all"
[Link] = [Link]
moreButton.TextColor3 = [Link](255, 255, 255)
moreButton.BackgroundColor3 = [Link](25, 0, 40)
[Link] = mainFrame
local rssToggle = [Link]("TextButton")
[Link] = [Link](0.1, 0, 0.1, 0)
[Link] = [Link](0.86, 0, 0.85, 0)
[Link] = "RSS"
[Link] = [Link]
rssToggle.TextColor3 = [Link](255, 255, 255)
rssToggle.BackgroundColor3 = [Link](25, 0, 40)
[Link] = mainFrame

local clickSound = [Link]("Sound")


[Link] = "rbxassetid://421058925"
[Link] = 0.7
[Link] = screenGui

-----------------------------------------------------------------
-- RSS PANEL
-----------------------------------------------------------------
local remotePanel = [Link]("Frame")
[Link] = [Link](2, 0, 1.2, 0)
[Link] = [Link](1, 10, 0, 0)
remotePanel.BackgroundColor3 = [Link](30, 0, 45)
[Link] = 0
[Link] = true
[Link] = false
[Link] = mainFrame

local title = [Link]("TextLabel")


[Link] = [Link](1, 0, 0.1, 0)
title.BackgroundColor3 = [Link](50, 0, 70)
[Link] = "RSS"
title.TextColor3 = [Link](180, 100, 255)
[Link] = [Link]
[Link] = remotePanel

local scrollingFrame = [Link]("ScrollingFrame")


[Link] = [Link](1, 0, 0.9, 0)
[Link] = [Link](0, 0, 0.1, 0)
[Link] = 1
[Link] = 5
[Link] = [Link].Y
[Link] = remotePanel

local uiList = [Link]("UIListLayout")


[Link] = [Link](0, 3)
[Link] = [Link]
[Link] = scrollingFrame

uiList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
[Link] = [Link](0, 0, 0, [Link].Y +
10)
end)

local showTween = TweenService:Create(remotePanel, [Link](0.45,


[Link]), {Size = [Link](2, 0, 1.2, 0)})
local hideTween = TweenService:Create(remotePanel, [Link](0.35,
[Link]), {Size = [Link](0, 0, 1.2, 0)})

local rssOpen = false


rssToggle.MouseButton1Click:Connect(function()
clickSound:Play()
rssOpen = not rssOpen
if rssOpen then
[Link] = true
[Link] = [Link](0, 0, 1.2, 0)
rssToggle.BackgroundColor3 = [Link](0, 200, 100)
showTween:Play()
else
rssToggle.BackgroundColor3 = [Link](25, 0, 40)
hideTween:Play()
[Link](0.4, function()
if not rssOpen then
[Link] = false
end
end)
end
end)

-- Storage for all remote buttons


local allRemoteButtons = {}

local selectedRemote = nil


local selectedButton = nil

local function makeButton(remote, pathName)


local btn = [Link]("TextButton")
[Link] = [Link](1, -10, 0, 38)
btn.BackgroundColor3 = [Link](55, 0, 75)
btn.TextColor3 = [Link](255, 255, 255)
[Link] = [Link]
[Link] = pathName
[Link] = 10
[Link] = [Link]
[Link] = [Link]
[Link] = scrollingFrame
[Link]("UICorner", btn).CornerRadius = [Link](0, 6)
[Link]("UIPadding", btn).PaddingLeft = [Link](0, 8)

-- Store reference
[Link](allRemoteButtons, {button = btn, remote = remote})

btn.MouseButton1Click:Connect(function()
clickSound:Play()
if selectedRemote == remote then
selectedRemote = nil
selectedButton = nil
btn.BackgroundColor3 = [Link](55, 0, 75)
return
end
if selectedButton then selectedButton.BackgroundColor3 = [Link](55,
0, 75) end
selectedRemote = remote
selectedButton = btn
btn.BackgroundColor3 = [Link](0, 200, 100)
end)
end

-- Select/Deselect ALL remotes with < button


moreButton.MouseButton1Click:Connect(function()
clickSound:Play()
if selectedRemote then
-- Deselect all
for _, entry in ipairs(allRemoteButtons) do
[Link].BackgroundColor3 = [Link](55, 0, 75)
end
selectedRemote = nil
selectedButton = nil
else
-- Select all
for _, entry in ipairs(allRemoteButtons) do
[Link].BackgroundColor3 = [Link](0, 200, 100)
end
-- You can choose to set selectedRemote to something like "ALL" or keep it
nil
-- Here we just visually select all, but execution still uses the last
clicked one unless modified further
selectedRemote = "MULTI" -- marker
selectedButton = nil
end
end)

local function findAllRemotes(parent, path)


for _, v in pairs(parent:GetChildren()) do
local newPath = path .. "." .. [Link]
if v:IsA("RemoteEvent") or v:IsA("RemoteFunction") then
makeButton(v, newPath)
end
if #v:GetChildren() > 0 then
findAllRemotes(v, newPath)
end
end
end

spawn(function()
[Link](4)
findAllRemotes([Link], "ReplicatedStorage")
findAllRemotes([Link], "StarterGui")
findAllRemotes([Link], "Workspace")
findAllRemotes([Link], "Players")
findAllRemotes([Link], "Lighting")
findAllRemotes([Link], "ServerStorage")
findAllRemotes([Link], "ServerScriptService")
end)

-----------------------------------------------------------------
-- EXECUTE (NO GREEN FLASH + SUPPORT FOR ALL REMOTES)
-----------------------------------------------------------------
executeButton.MouseButton1Click:Connect(function()
local text = [Link]

-- Remote mode
if selectedRemote then
if text == "" then
local c = executeButton.BackgroundColor3
executeButton.BackgroundColor3 = [Link](200, 120, 30)
[Link](0.25, function() executeButton.BackgroundColor3 = c end)
return
end

if selectedRemote == "MULTI" then


-- Fire ALL selected (visually green) remotes
for _, entry in ipairs(allRemoteButtons) do
if [Link].BackgroundColor3 == [Link](0, 200, 100)
then
if [Link]:IsA("RemoteEvent") then
[Link]:FireServer(text)
elseif [Link]:IsA("RemoteFunction") then
spawn(function()
local ok, result = pcall(function()
return [Link]:InvokeServer(text)
end)
if ok then print("RemoteFunction returned:", result)
end
end)
end
end
end
else
-- Single remote
if selectedRemote:IsA("RemoteEvent") then
selectedRemote:FireServer(text)
elseif selectedRemote:IsA("RemoteFunction") then
spawn(function()
local ok, result = pcall(function()
return selectedRemote:InvokeServer(text)
end)
if ok then print("RemoteFunction returned:", result) end
end)
end
end

-- REMOVED GREEN FLASH


return
end

-- Local execution
local env = getfenv()
[Link] = require
[Link] = print
[Link] = warn
[Link] = error
[Link] = player
[Link] = game
[Link] = workspace
[Link] = UIS
[Link] = TweenService
env._G = _G

local fn = loadstring(text)
if fn then
setfenv(fn, env)
pcall(fn)
else
warn("Loadstring error")
end
end)
clearButton.MouseButton1Click:Connect(function()
[Link] = ""
end)

print("Krypton - Modified: < button selects all remotes + removed green execute
flash")

You might also like