Advertisement
JS_sevices0_0

FLEX YOUR FPS{not sure if works}

Aug 1st, 2024
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. FLEX YOUR FPS {let me know if it works}
  2. local Players = game:GetService("Players")
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4.  
  5. local player = Players.LocalPlayer
  6. local screenGui = Instance.new("ScreenGui")
  7. screenGui.Name = "FPSControlGUI"
  8. screenGui.Parent = player:WaitForChild("PlayerGui")
  9.  
  10. local frame = Instance.new("Frame")
  11. frame.Size = UDim2.new(0, 300, 0, 250)
  12. frame.Position = UDim2.new(0, 10, 0, 10)
  13. frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  14. frame.Parent = screenGui
  15.  
  16. local function makeDraggable(frame)
  17. local dragToggle = nil
  18. local dragInput = nil
  19. local dragStart = nil
  20. local startPos = nil
  21.  
  22. frame.InputBegan:Connect(function(input)
  23. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  24. dragToggle = true
  25. dragStart = input.Position
  26. startPos = frame.Position
  27.  
  28. input.Changed:Connect(function()
  29. if input.UserInputState == Enum.UserInputState.End then
  30. dragToggle = false
  31. end
  32. end)
  33. end
  34. end)
  35.  
  36. frame.InputChanged:Connect(function(input)
  37. if input.UserInputType == Enum.UserInputType.MouseMovement then
  38. dragInput = input
  39. end
  40. end)
  41.  
  42. game:GetService("RunService").RenderStepped:Connect(function()
  43. if dragToggle and dragInput then
  44. local delta = dragInput.Position - dragStart
  45. frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  46. end
  47. end)
  48. end
  49.  
  50. makeDraggable(frame)
  51.  
  52. local fpsLabel = Instance.new("TextLabel")
  53. fpsLabel.Size = UDim2.new(1, 0, 0, 30)
  54. fpsLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  55. fpsLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  56. fpsLabel.Text = "FPS Control"
  57. fpsLabel.Parent = frame
  58.  
  59. local fpsInput = Instance.new("TextBox")
  60. fpsInput.Size = UDim2.new(1, -20, 0, 30)
  61. fpsInput.Position = UDim2.new(0, 10, 0, 40)
  62. fpsInput.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  63. fpsInput.TextColor3 = Color3.fromRGB(0, 0, 0)
  64. fpsInput.PlaceholderText = "Enter FPS Value"
  65. fpsInput.Parent = frame
  66.  
  67. local fluctuationInput = Instance.new("TextBox")
  68. fluctuationInput.Size = UDim2.new(1, -20, 0, 30)
  69. fluctuationInput.Position = UDim2.new(0, 10, 0, 80)
  70. fluctuationInput.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  71. fluctuationInput.TextColor3 = Color3.fromRGB(0, 0, 0)
  72. fluctuationInput.PlaceholderText = "Enter Fluctuation Range"
  73. fluctuationInput.Parent = frame
  74.  
  75. local waitTimeInput = Instance.new("TextBox")
  76. waitTimeInput.Size = UDim2.new(1, -20, 0, 30)
  77. waitTimeInput.Position = UDim2.new(0, 10, 0, 120)
  78. waitTimeInput.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  79. waitTimeInput.TextColor3 = Color3.fromRGB(0, 0, 0)
  80. waitTimeInput.PlaceholderText = "Enter Wait Time (s)"
  81. waitTimeInput.Parent = frame
  82.  
  83. local enterButton = Instance.new("TextButton")
  84. enterButton.Size = UDim2.new(1, -20, 0, 30)
  85. enterButton.Position = UDim2.new(0, 10, 0, 160)
  86. enterButton.BackgroundColor3 = Color3.fromRGB(0, 128, 0)
  87. enterButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  88. enterButton.Text = "Apply"
  89. enterButton.Parent = frame
  90.  
  91. local clearButton = Instance.new("TextButton")
  92. clearButton.Size = UDim2.new(1, -20, 0, 30)
  93. clearButton.Position = UDim2.new(0, 10, 0, 200)
  94. clearButton.BackgroundColor3 = Color3.fromRGB(128, 0, 0)
  95. clearButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  96. clearButton.Text = "Clear FPS"
  97. clearButton.Parent = frame
  98.  
  99. local notification = Instance.new("TextLabel")
  100. notification.Size = UDim2.new(1, 0, 0, 50)
  101. notification.Position = UDim2.new(0, 0, 1, -50)
  102. notification.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  103. notification.TextColor3 = Color3.fromRGB(255, 255, 255)
  104. notification.Text = "GUI Hidden"
  105. notification.Visible = false
  106. notification.Parent = screenGui
  107.  
  108. local UserInputService = game:GetService("UserInputService")
  109. local isVisible = true
  110.  
  111. UserInputService.InputBegan:Connect(function(input)
  112. if input.KeyCode == Enum.KeyCode.RightShift then
  113. isVisible = not isVisible
  114. frame.Visible = isVisible
  115. notification.Visible = not isVisible
  116. notification.Text = isVisible and "GUI Visible" or "GUI Hidden"
  117. end
  118. end)
  119.  
  120. local fluctuationCoroutine = nil
  121. local storedFPS = 1000
  122.  
  123. local function stopFluctuation()
  124. if fluctuationCoroutine then
  125. coroutine.close(fluctuationCoroutine)
  126. fluctuationCoroutine = nil
  127. end
  128. end
  129.  
  130. clearButton.MouseButton1Click:Connect(function()
  131. stopFluctuation()
  132. local args = { [1] = storedFPS }
  133. ReplicatedStorage.UpdateFPS:FireServer(unpack(args))
  134. fpsInput.Text = tostring(storedFPS)
  135. fluctuationInput.Text = "0"
  136. waitTimeInput.Text = "0.01"
  137. end)
  138.  
  139. local function applyFPSSettings(fpsValue, fluctuationRange, waitTime)
  140. if waitTime <= 0 then
  141. waitTime = 0.01
  142. end
  143.  
  144. while true do
  145. local fluctuation = math.random(-fluctuationRange, fluctuationRange)
  146. local fluctuatedValue = fpsValue + fluctuation
  147.  
  148. local args = { fluctuatedValue }
  149. ReplicatedStorage.UpdateFPS:FireServer(unpack(args))
  150. wait(waitTime)
  151. end
  152. end
  153.  
  154. enterButton.MouseButton1Click:Connect(function()
  155. storedFPS = tonumber(fpsInput.Text) or 1000
  156. local fluctuationRange = tonumber(fluctuationInput.Text) or 10
  157. local waitTime = tonumber(waitTimeInput.Text) or 0.01
  158.  
  159. stopFluctuation()
  160. fluctuationCoroutine = coroutine.create(function()
  161. applyFPSSettings(storedFPS, fluctuationRange, waitTime)
  162. end)
  163. coroutine.resume(fluctuationCoroutine)
  164. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement