1. --Made by tupsutumppu#3145
  2. local DiscordLib = loadstring(game:HttpGet("https://raw.githubusercontent.com/dawid-scripts/UI-Libs/main/discord%20lib.txt"))()
  3. local win = DiscordLib:Window("PTFS Plane Speed Modifier")
  4. local serv = win:Server("super op script", "")
  5. local maxSpeedChannel = serv:Channel("Max Speed")
  6. local accelerationChannel = serv:Channel("Acceleration")
  7. local settings = {
  8. maxSpeed = nil,
  9. acceleration = nil
  10. }
  11. local function mod(target, value)
  12. for _, v in pairs(getgc()) do
  13. if type(v) == "function" and tostring(getfenv(v).script) == "Control" then
  14. local upvalues = debug.getupvalues(v)
  15. for i, upvalue in pairs(upvalues) do
  16. if upvalue == target then
  17. debug.setupvalue(v, i, value)
  18. local str = "Original value: " .. tostring(target) .. " | New Value: " .. tostring(value)
  19. DiscordLib:Notification("Success!" ,str, "Close")
  20. end
  21. end
  22. break
  23. end
  24. end
  25. end
  26. maxSpeedChannel:Textbox("MaxSpeed", "Type here!", true, function(text)
  27. settings.maxSpeed = tonumber(text) or settings.maxSpeed
  28. end)
  29. maxSpeedChannel:Button("Apply New MaxSpeed", function()
  30. if settings.maxSpeed ~= nil then
  31. local seatPart = game.Players.LocalPlayer.Character.Humanoid.SeatPart
  32. if seatPart then
  33. local fullName = seatPart:GetFullName()
  34. local secondName = fullName:split(".")[3]
  35. local maxSpeedValue = game.Workspace.Aircraft[tostring(secondName)]:GetAttribute("MaxSpeed")
  36. mod(maxSpeedValue, settings.maxSpeed)
  37. else
  38. DiscordLib:Notification("Notification", "Must be in a plane!", "Close")
  39. end
  40. else
  41. DiscordLib:Notification("Notification", "MaxSpeed cannot be 'nil'. Did you forget to press 'Enter' after providing a value?", "Close")
  42. end
  43. end)
  44. accelerationChannel:Textbox("Acceleration", "Type here!", true, function(text)
  45. settings.acceleration = tonumber(text) or settings.acceleration
  46. end)
  47. accelerationChannel:Button("Apply New Acceleration", function()
  48. if settings.acceleration ~= nil then
  49. local seatPart = game.Players.LocalPlayer.Character.Humanoid.SeatPart
  50. if seatPart then
  51. local fullName = seatPart:GetFullName()
  52. local secondName = fullName:split(".")[3]
  53. local accelerationValue = game.Workspace.Aircraft[tostring(secondName)]:GetAttribute("Acceleration")
  54. mod(accelerationValue, settings.acceleration)
  55. else
  56. DiscordLib:Notification("Notification", "Must be in a plane!", "Close")
  57. end
  58. else
  59. DiscordLib:Notification("Notification", "Acceleration cannot be 'nil'. Did you forget to press 'Enter' after providing a value?", "Close")
  60. end
  61. end)