Advertisement
1x5x0x7x3

Rebirth Champions Script (Auto Hatch Egg, Auto Craft, Collect All Chests)

Nov 9th, 2022 (edited)
2,690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.35 KB | Gaming | 0 0
  1. -- This script was made by 1x5x0x7x3#5168. Requested by: N0cturn0_#8742.
  2. -- Note: This script was made based off another script (that was much more ugly and didn't work properly). I (1x5x0x7x3) have never played Rebirth Legends before. I was merely asked if I understood scripting, responded yes, given that other script, and was asked what was wrong and how to fix it. Ended up rewriting the entire thing.
  3.  
  4. local plr = game:GetService("Players").LocalPlayer
  5. local uis = game:GetService("UserInputService")
  6. local rs = game:GetService("ReplicatedStorage")
  7.  
  8. getgenv().Craft = false;
  9. getgenv().Egg = false;
  10.  
  11. local config = {
  12.     ["CraftDelay"] = 20; -- wait before crafting
  13.     ["TPDelay"] = 0.3; -- wait before TPChest moves on to another chest
  14.     ["EggHatchDelay"] = 0.1; -- wait before hatching an egg
  15.     ["Egg"] = {"EGGNAME", "Triple"}
  16. }
  17.  
  18. local keybinds = {
  19.     ["TPChest"] = Enum.KeyCode.E;
  20.     ["AutoCraft"] = Enum.KeyCode.G;
  21.     ["EggHatch"] = Enum.KeyCode.H;
  22. }
  23.  
  24. local pos = CFrame.new
  25.  
  26. local chestLocations = {pos(244,5,-33);pos(-443,35,510);pos(975,-49,133);pos(-418,36,-458);pos(215,48,-483);pos(580,36,-775);pos(368,90,-2000);pos(905,9,-388);pos(-934,43,-316);pos(-242,-57,-256);pos(-2146,4,-304);pos(-676,3,1113);}
  27.  
  28. -- TPChest
  29.  
  30. local function tpChest(hrp)
  31.     if hrp ~= nil then
  32.         for _,v in pairs(chestLocations) do
  33.             if hrp ~= nil then
  34.                 hrp.CFrame = v
  35.                 wait(config.TPDelay)
  36.             end
  37.         end
  38.     end
  39. end
  40.  
  41.  
  42. uis.InputBegan:Connect(function(key,gpe)
  43.     local chr = plr.Character or plr.CharacterAdded:Wait()
  44.     local hrp = chr:FindFirstChild("HumanoidRootPart")
  45.     if not gpe and hrp ~= nil then -- If not doing anything else (typing in chat or something like that)
  46.         key = key.KeyCode
  47.         if key == keybinds.TPChest then
  48.             tpChest(hrp)
  49.         elseif key == keybinds.EggHatch then
  50.             if getgenv().Egg == false then
  51.                 getgenv().Egg = true
  52.                 repeat
  53.                     wait(config.EggHatchDelay)
  54.                     rs.Functions.Unbox:InvokeServer(unpack(config.Egg))
  55.                 until getgenv().Egg == false
  56.             elseif getgenv().Egg == true then
  57.                 getgenv().Egg = false
  58.             end
  59.         elseif key == keybinds.AutoCraft then
  60.             if getgenv().Craft == false then
  61.                 getgenv().Craft = true
  62.                 repeat
  63.                     rs.Functions.Request:InvokeServer("CraftAll",{})
  64.                     wait(config.CraftDelay)
  65.                 until getgenv().Craft == false
  66.             elseif getgenv().Craft == true then
  67.                 getgenv().Craft = false
  68.             end
  69.         end
  70.     end
  71. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement