Advertisement
EpicGamerSander1345

Sander's GUI

Apr 20th, 2025 (edited)
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.08 KB | Source Code | 0 0
  1. local ScreenGui = Instance.new("ScreenGui")
  2. local LoadingFrame = Instance.new("Frame")
  3. local LoadingBarBackground = Instance.new("Frame")
  4. local LoadingBar = Instance.new("Frame")
  5. local LoadingText = Instance.new("TextLabel")
  6. local Frame = Instance.new("Frame")
  7. local Title = Instance.new("TextLabel")
  8. local TextBox = Instance.new("TextBox")
  9. local FlingButton = Instance.new("TextButton")
  10. local StopFlingButton = Instance.new("TextButton")
  11. local Players = game:GetService("Players")
  12.  
  13. -- Ensure the script is a LocalScript and parent GUI to Player's PlayerGui
  14. local player = Players.LocalPlayer
  15. local playerGui = player:WaitForChild("PlayerGui")
  16. ScreenGui.Parent = playerGui
  17.  
  18. -- Configure Loading Screen
  19. LoadingFrame.Size = UDim2.new(0, 400, 0, 200)
  20. LoadingFrame.Position = UDim2.new(0.5, -200, 0.5, -100)
  21. LoadingFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  22. LoadingFrame.BorderSizePixel = 0
  23. LoadingFrame.Parent = ScreenGui
  24.  
  25. LoadingText.Size = UDim2.new(1, 0, 0.3, 0)
  26. LoadingText.Position = UDim2.new(0, 0, 0.1, 0)
  27. LoadingText.BackgroundTransparency = 1
  28. LoadingText.Text = "Loading..."
  29. LoadingText.TextColor3 = Color3.fromRGB(255, 255, 255)
  30. LoadingText.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  31. LoadingText.TextStrokeTransparency = 0
  32. LoadingText.Font = Enum.Font.GothamBold
  33. LoadingText.TextSize = 20
  34. LoadingText.Parent = LoadingFrame
  35.  
  36. LoadingBarBackground.Size = UDim2.new(0.8, 0, 0.2, 0)
  37. LoadingBarBackground.Position = UDim2.new(0.1, 0, 0.6, 0)
  38. LoadingBarBackground.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  39. LoadingBarBackground.BorderSizePixel = 0
  40. LoadingBarBackground.Parent = LoadingFrame
  41.  
  42. LoadingBar.Size = UDim2.new(0, 0, 1, 0)
  43. LoadingBar.Position = UDim2.new(0, 0, 0, 0)
  44. LoadingBar.BackgroundColor3 = Color3.fromRGB(70, 130, 180)
  45. LoadingBar.BorderSizePixel = 0
  46. LoadingBar.Parent = LoadingBarBackground
  47.  
  48. -- Add rounded corners to loading elements
  49. local function addUICorner(instance, radius)
  50.     local uiCorner = Instance.new("UICorner")
  51.     uiCorner.CornerRadius = UDim.new(0, radius)
  52.     uiCorner.Parent = instance
  53. end
  54.  
  55. addUICorner(LoadingFrame, 10)
  56. addUICorner(LoadingBarBackground, 10)
  57. addUICorner(LoadingBar, 10)
  58.  
  59. -- Smooth loading animation
  60. local function playLoadingAnimation()
  61.     for i = 1, 100 do
  62.         LoadingBar:TweenSize(UDim2.new(i / 100, 0, 1, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.02, true)
  63.         wait(0.02)
  64.     end
  65.     LoadingFrame:Destroy()
  66. end
  67.  
  68. -- Start loading animation
  69. playLoadingAnimation()
  70.  
  71. -- Configure Main GUI
  72. Frame.Size = UDim2.new(0, 350, 0, 300)
  73. Frame.Position = UDim2.new(0.5, -175, 0.5, -150)
  74. Frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  75. Frame.BorderSizePixel = 0
  76. Frame.Active = true
  77. Frame.Draggable = true
  78. Frame.Parent = ScreenGui
  79.  
  80. -- Configure Title
  81. Title.Size = UDim2.new(1, 0, 0, 40)
  82. Title.Position = UDim2.new(0, 0, 0, 0)
  83. Title.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  84. Title.BorderSizePixel = 0
  85. Title.Text = "Sander's Fling GUI"
  86. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  87. Title.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  88. Title.TextStrokeTransparency = 0
  89. Title.Font = Enum.Font.GothamBold
  90. Title.TextSize = 20
  91. Title.Parent = Frame
  92.  
  93. -- Configure TextBox
  94. TextBox.Size = UDim2.new(0.9, 0, 0, 40)
  95. TextBox.Position = UDim2.new(0.05, 0, 0.2, 0)
  96. TextBox.PlaceholderText = "Enter part of username..."
  97. TextBox.Text = ""
  98. TextBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  99. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  100. TextBox.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  101. TextBox.TextStrokeTransparency = 0
  102. TextBox.Font = Enum.Font.Gotham
  103. TextBox.TextSize = 16
  104. TextBox.BorderSizePixel = 0
  105. TextBox.Parent = Frame
  106.  
  107. -- Configure Fling Button
  108. FlingButton.Size = UDim2.new(0.9, 0, 0, 40)
  109. FlingButton.Position = UDim2.new(0.05, 0, 0.4, 0)
  110. FlingButton.Text = "Fling Target"
  111. FlingButton.BackgroundColor3 = Color3.fromRGB(70, 130, 180)
  112. FlingButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  113. FlingButton.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  114. FlingButton.TextStrokeTransparency = 0
  115. FlingButton.Font = Enum.Font.GothamBold
  116. FlingButton.TextSize = 16
  117. FlingButton.BorderSizePixel = 0
  118. FlingButton.Parent = Frame
  119.  
  120. -- Configure Stop Fling Button
  121. StopFlingButton.Size = UDim2.new(0.9, 0, 0, 40)
  122. StopFlingButton.Position = UDim2.new(0.05, 0, 0.6, 0)
  123. StopFlingButton.Text = "Stop Fling"
  124. StopFlingButton.BackgroundColor3 = Color3.fromRGB(220, 20, 60)
  125. StopFlingButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  126. StopFlingButton.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  127. StopFlingButton.TextStrokeTransparency = 0
  128. StopFlingButton.Font = Enum.Font.GothamBold
  129. StopFlingButton.TextSize = 16
  130. StopFlingButton.BorderSizePixel = 0
  131. StopFlingButton.Parent = Frame
  132.  
  133. -- Add rounded corners to main GUI elements
  134. addUICorner(Frame, 10)
  135. addUICorner(Title, 10)
  136. addUICorner(TextBox, 10)
  137. addUICorner(FlingButton, 10)
  138. addUICorner(StopFlingButton, 10)
  139.  
  140. -- Function to find player by partial name
  141. local function findPlayerByName(partialName)
  142.     for _, player in ipairs(Players:GetPlayers()) do
  143.         if string.find(string.lower(player.Name), string.lower(partialName)) or
  144.            string.find(string.lower(player.DisplayName), string.lower(partialName)) then
  145.             return player
  146.         end
  147.     end
  148.     return nil
  149. end
  150.  
  151. -- Function to update the textbox with the full name
  152. local function updateTextBoxWithFullName(player)
  153.     TextBox.Text = "@" .. player.DisplayName .. ", " .. player.Name
  154. end
  155.  
  156. -- Variables to manage fling state
  157. local activeBodyVelocity = nil
  158. local flingConnection = nil
  159.  
  160. -- Fling Button click event
  161. FlingButton.MouseButton1Click:Connect(function()
  162.     local partialName = TextBox.Text
  163.     if partialName == "" then
  164.         warn("Please enter a username.")
  165.         return
  166.     end
  167.  
  168.     local targetPlayer = findPlayerByName(partialName)
  169.     if not targetPlayer then
  170.         warn("Player not found.")
  171.         return
  172.     end
  173.  
  174.     updateTextBoxWithFullName(targetPlayer)
  175.  
  176.     local targetCharacter = targetPlayer.Character
  177.     local localCharacter = Players.LocalPlayer.Character
  178.  
  179.     if targetCharacter and localCharacter then
  180.         local targetTorso = targetCharacter:FindFirstChild("HumanoidRootPart")
  181.         if not targetTorso then
  182.             warn("Target's HumanoidRootPart not found.")
  183.             return
  184.         end
  185.        
  186.         local localTorso = localCharacter:FindFirstChild("HumanoidRootPart")
  187.         if targetTorso and localTorso then
  188.             -- Attach local player to target's torso
  189.             localTorso.CFrame = targetTorso.CFrame
  190.  
  191.             -- Apply extremely powerful and instant fling velocity to target
  192.             local bodyVelocity = Instance.new("BodyVelocity")
  193.             bodyVelocity.Velocity = Vector3.new(0, 1e9, 0) -- Increased upward velocity for a stronger fling
  194.             bodyVelocity.MaxForce = Vector3.new(1e9, 1e9, 1e9) -- Increased max force
  195.             bodyVelocity.Parent = targetTorso
  196.  
  197.             -- Store the BodyVelocity instance
  198.             activeBodyVelocity = bodyVelocity
  199.  
  200.             -- Continuously update local player's position to stay inside the target's torso
  201.             flingConnection = game:GetService("RunService").Heartbeat:Connect(function()
  202.                 if not targetTorso or not localTorso or not activeBodyVelocity then
  203.                     if flingConnection then
  204.                         flingConnection:Disconnect()
  205.                         flingConnection = nil
  206.                     end
  207.                     return
  208.                 end
  209.                 localTorso.CFrame = targetTorso.CFrame
  210.             end)
  211.         end
  212.     end
  213. end)
  214.  
  215. -- Stop Fling Button click event
  216. StopFlingButton.MouseButton1Click:Connect(function()
  217.     if activeBodyVelocity then
  218.         activeBodyVelocity:Destroy()
  219.         activeBodyVelocity = nil
  220.     end
  221.  
  222.     if flingConnection then
  223.         flingConnection:Disconnect()
  224.         flingConnection = nil
  225.     end
  226.  
  227.     -- Reset player's health to respawn
  228.     local character = player.Character
  229.     if character then
  230.         local humanoid = character:FindFirstChild("Humanoid")
  231.         if humanoid then
  232.             humanoid.Health = 0
  233.         end
  234.     end
  235. end)
  236.  
Tags: Roblox lua
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement