Guest User

forsaken script

a guest
Jan 9th, 2025
1,439
-1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.84 KB | None | 0 1
  1. local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
  2.  
  3. local Sprinting = game:GetService("ReplicatedStorage").Systems.Character.Game.Sprinting
  4. local m = require(Sprinting)
  5.  
  6. local Window = Rayfield:CreateWindow({
  7.     Name = "forsakened",
  8.     LoadingTitle = "loading mr forsaken",
  9.     LoadingSubtitle = "hello guys",
  10.     ConfigurationSaving = {
  11.         Enabled = true,
  12.         FolderName = nil,
  13.         FileName = "forsaken",
  14.     },
  15.     KeySystem = false
  16. })
  17.  
  18. local GeneratorTab = Window:CreateTab("auto generator")
  19. local SpeedTab = Window:CreateTab("speed and stamina")
  20.  
  21. local maxDistance = 20
  22. local loopEnabled = false
  23.  
  24. GeneratorTab:CreateLabel("its random but it gets there fast enough for me to not care", 4483362458, Color3.fromRGB(255, 255, 255), false)
  25.  
  26. GeneratorTab:CreateSlider({
  27.     Name = "the distance or something",
  28.     Range = {1, 500},
  29.     Increment = 0.00001,
  30.     Suffix = "studs",
  31.     CurrentValue = maxDistance,
  32.     Callback = function(Value)
  33.         if Value then
  34.             maxDistance = Value
  35.         else
  36.             maxDistance = 20 -- Default fallback in case Value is nil
  37.         end
  38.     end
  39. })
  40.  
  41. GeneratorTab:CreateToggle({
  42.     Name = "auto geneartor",
  43.     CurrentValue = false,
  44.     Flag = "AutoGenToggle",
  45.     Callback = function(Value)
  46.         loopEnabled = Value
  47.     end
  48. })
  49.  
  50. SpeedTab:CreateLabel("you'll have to re-set these and speed each respawn", 4483362458, Color3.fromRGB(255, 255, 255), false)
  51.  
  52. SpeedTab:CreateSlider({
  53.     Name = "max",
  54.     Range = {50, 200},
  55.     Increment = 1,
  56.     Suffix = "stamina",
  57.     CurrentValue = m.MaxStamina,
  58.     Callback = function(Value)
  59.         m.MaxStamina = Value
  60.     end
  61. })
  62.  
  63. SpeedTab:CreateSlider({
  64.     Name = "gain",
  65.     Range = {1, 100},
  66.     Increment = 1,
  67.     Suffix = "gain per second",
  68.     CurrentValue = m.StaminaGain,
  69.     Callback = function(Value)
  70.         m.StaminaGain = Value
  71.     end
  72. })
  73.  
  74. SpeedTab:CreateSlider({
  75.     Name = "loss",
  76.     Range = {1, 50},
  77.     Increment = 1,
  78.     Suffix = "loss per second",
  79.     CurrentValue = m.StaminaLoss,
  80.     Callback = function(Value)
  81.         m.StaminaLoss = Value
  82.     end
  83. })
  84.  
  85. SpeedTab:CreateLabel("sprintspeed does not update until you start sprinting again", 4483362458, Color3.fromRGB(255, 255, 255), false)
  86. SpeedTab:CreateSlider({
  87.     Name = "speed",
  88.     Range = {16, 50},
  89.     Increment = 1,
  90.     Suffix = "speed",
  91.     CurrentValue = m.SprintSpeed,
  92.     Callback = function(Value)
  93.         m.SprintSpeed = Value
  94.     end
  95. })
  96.  
  97. local Players = game:GetService("Players")
  98. local LocalPlayer = Players.LocalPlayer
  99. local HumanoidRootPart = nil
  100.  
  101. local function fireClickDetector(clickDetector)
  102.     if clickDetector and clickDetector:IsA("ClickDetector") then
  103.         fireclickdetector(clickDetector)
  104.     end
  105. end
  106.  
  107. local function processButtonsModel(buttonsModel)
  108.     if not HumanoidRootPart then return end
  109.  
  110.     local validColors = {
  111.         Color3.fromRGB(0, 150, 0),
  112.         Color3.fromRGB(150, 0, 0)
  113.     }
  114.  
  115.     local ignoredColor = Color3.fromRGB(160, 145, 80)
  116.     local clickDetectors = {}
  117.  
  118.     for _, child in pairs(buttonsModel:GetDescendants()) do
  119.         if child:IsA("MeshPart") then
  120.             if child.Color == ignoredColor then
  121.                 continue
  122.             end
  123.  
  124.             local isValidColor = false
  125.             for _, validColor in pairs(validColors) do
  126.                 if child.Color == validColor then
  127.                     isValidColor = true
  128.                     break
  129.                 end
  130.             end
  131.  
  132.             if isValidColor then
  133.                 local clickDetector = child:FindFirstChildWhichIsA("ClickDetector")
  134.                 if clickDetector then
  135.                     local distance = (child.Position - HumanoidRootPart.Position).Magnitude
  136.                     if distance <= maxDistance then
  137.                         table.insert(clickDetectors, clickDetector)
  138.                     end
  139.                 end
  140.             end
  141.         end
  142.     end
  143.  
  144.     if #clickDetectors > 0 then
  145.         local randomIndex = math.random(1, #clickDetectors)
  146.         fireClickDetector(clickDetectors[randomIndex])
  147.     end
  148. end
  149.  
  150. local function updateCharacterReferences()
  151.     local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  152.     HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
  153. end
  154.  
  155. updateCharacterReferences()
  156.  
  157. LocalPlayer.CharacterAdded:Connect(updateCharacterReferences)
  158.  
  159. task.spawn(function()
  160.     while task.wait() do
  161.         if loopEnabled and HumanoidRootPart then
  162.             for _, generator in pairs(workspace.Map.Ingame.Map:GetChildren()) do
  163.                 if generator:IsA("Model") and generator:FindFirstChild("Puzzle") and generator.Puzzle:FindFirstChild("Buttons") then
  164.                     processButtonsModel(generator.Puzzle.Buttons)
  165.                 end
  166.             end
  167.         end
  168.     end
  169. end)
  170.  
Advertisement
Add Comment
Please, Sign In to add comment