Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Place this script in StarterPlayerScripts or StarterGui
- -- Configuration settings
- local Config = {
- EnableMovement = true,
- Xp = true,
- disableShooting = false,
- Multiplier = 100,
- AutoPlay = true,
- AutoShoot = true, -- Change this to false if you don't want auto shoot
- ChangeValue = 1,
- ServerPlayers = 10 -- Example value; adjust as needed
- }
- local allowedPlaceIds = {
- [14269621394] = true,
- [15297128281] = true
- }
- local teleportPlaceId = 15297128281
- local player = game.Players.LocalPlayer
- -- Check if the current PlaceId is allowed
- if not allowedPlaceIds[game.PlaceId] then
- print("Current PlaceId is not allowed. Teleporting to", teleportPlaceId)
- game:GetService("TeleportService"):Teleport(teleportPlaceId, player)
- return
- end
- local args = {
- [1] = "Change Ready Settings",
- [2] = true
- }
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Remotes = ReplicatedStorage:WaitForChild("Remotes")
- local MainRE = Remotes:WaitForChild("Main.RE")
- -- Existing logic
- if game.PlaceId == 15297128281 then
- print("In the correct place. Starting MainRE.")
- while true do
- MainRE:FireServer(unpack(args))
- wait(1)
- end
- else
- print("Not in the correct place. Current PlaceId:", game.PlaceId)
- end
- local VirtualUser = game:GetService('VirtualUser')
- local StarterGui = game:GetService('StarterGui')
- StarterGui:SetCore("SendNotification", { Title = "Anti-AFK", Text = "Script Activated", Duration = 5 })
- player.Idled:Connect(function()
- VirtualUser:CaptureController()
- VirtualUser:ClickButton2(Vector2.new())
- end)
- local function disableAFKCheck()
- local function disableScriptInGui(gui)
- local afkCheckScript = gui:FindFirstChild("AFK.Check")
- if afkCheckScript and afkCheckScript:IsA("LocalScript") then
- afkCheckScript.Disabled = true
- print("AFK.Check script in", gui.Name, "is disabled.")
- else
- print("AFK.Check script not found or not a LocalScript in", gui.Name, ".")
- end
- end
- local starterGuiAFKUi = StarterGui:FindFirstChild("AFK.Ui")
- if starterGuiAFKUi then
- disableScriptInGui(starterGuiAFKUi)
- else
- print("AFK.Ui not found in StarterGui.")
- end
- local playerGuiAFKUi = player.PlayerGui:FindFirstChild("AFK.Ui")
- if playerGuiAFKUi then
- disableScriptInGui(playerGuiAFKUi)
- else
- print("AFK.Ui not found in PlayerGui.")
- end
- end
- disableAFKCheck()
- local backpack = player:WaitForChild("Backpack")
- local actionValues = backpack:WaitForChild("ActionValues")
- local power = actionValues:WaitForChild("Power")
- local function onPowerChanged()
- if power.Value >= Config.ChangeValue and Config.Xp and not Config.disableShooting then
- print("Power changed to", power.Value, "- preparing to shoot.")
- local args = {
- [1] = false,
- [2] = "Shooting",
- [3] = "Standing Shot"
- }
- local shotMultiplier = Config.Multiplier
- local playerEvents = backpack:FindFirstChild("PlayerEvents") or ReplicatedStorage:FindFirstChild("PlayerEvents")
- if playerEvents then
- local shootingEvent = playerEvents:FindFirstChild("Shooting")
- if shootingEvent then
- for i = 1, shotMultiplier do
- shootingEvent:FireServer(unpack(args))
- end
- print("Fired", shotMultiplier, "shots.")
- else
- warn("Shooting event not found in PlayerEvents.")
- end
- else
- warn("PlayerEvents folder not found in either Backpack or ReplicatedStorage.")
- end
- end
- end
- power:GetPropertyChangedSignal("Value"):Connect(onPowerChanged)
- local function disableShooting()
- Config.Xp = false
- Config.disableShooting = true
- Config.AutoPlay = false
- Config.AutoShoot = false
- print("Shooting and AutoPlay have been disabled as the warm-up is finished.")
- end
- local gameValues = ReplicatedStorage:WaitForChild("GameValues")
- local warmupFinished = gameValues:WaitForChild("WarmupFinished")
- if warmupFinished.Value == true then
- print("Warmup is finished!")
- disableShooting()
- else
- print("Warmup is not finished yet.")
- end
- warmupFinished:GetPropertyChangedSignal("Value"):Connect(function()
- if warmupFinished.Value == true then
- print("Warmup is finished now!")
- disableShooting()
- end
- end)
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local positions = {
- Vector3.new(21, 4, -433),
- Vector3.new(-47, 4, -434),
- Vector3.new(21, 4, -408),
- Vector3.new(-47, 4, -409)
- }
- local hasShot = false
- local function AutoShoot()
- if not Config.AutoShoot or warmupFinished.Value or hasShot then
- return
- end
- local ball = workspace:FindFirstChild("Balls") and workspace.Balls:FindFirstChild("Ball")
- if ball then
- print("Player has the ball. Shooting...")
- wait(0.5)
- local args = {
- [1] = true,
- [2] = "Shooting",
- [3] = "Standing Shot"
- }
- ReplicatedStorage:WaitForChild("PlayerEvents"):WaitForChild("Shooting"):FireServer(unpack(args))
- hasShot = true
- print("Shot fired. AutoShoot will be disabled.")
- else
- print("Player does not have the ball.")
- end
- end
- local function AutoPlay()
- while Config.AutoPlay do
- if warmupFinished.Value then
- print("Warm-up is finished. AutoPlay will not walk to positions.")
- return
- end
- walkToNearestPosition()
- wait(2)
- end
- end
- function walkToNearestPosition()
- if game.PlaceId ~= 14269621394 then
- return
- end
- if warmupFinished.Value then
- print("Warmup is finished. Cannot move to the positions.")
- return
- end
- local playerPosition = character.HumanoidRootPart.Position
- local nearestPosition = nil
- local minDistance = math.huge
- for _, pos in pairs(positions) do
- local distance = (pos - playerPosition).magnitude
- if distance < minDistance then
- nearestPosition = pos
- minDistance = distance
- end
- end
- if nearestPosition and Config.EnableMovement then
- print("Moving to nearest position at: " .. tostring(nearestPosition))
- humanoid:MoveTo(nearestPosition)
- local moveToConnection
- moveToConnection = humanoid.MoveToFinished:Connect(function(reached)
- if reached then
- if Config.AutoShoot and not warmupFinished.Value and not hasShot then
- AutoShoot()
- end
- else
- print("Failed to reach the position. Trying again...")
- humanoid:MoveTo(nearestPosition)
- end
- end)
- else
- print("No valid positions found or movement is disabled.")
- end
- end
- if Config.AutoPlay then
- print("Starting AutoPlay...")
- AutoPlay()
- else
- print("AutoPlay is disabled.")
- end
- if Config.AutoShoot and not warmupFinished.Value and not hasShot then
- print("Starting AutoShoot...")
- AutoShoot()
- else
- print("AutoShoot is disabled or has already shot.")
- end
- local placeId = game.PlaceId
- local maxPlayersLimit = Config.ServerPlayers
- if placeId == 15297128281 then
- local function serverHop()
- local HttpService = game:GetService("HttpService")
- local servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?sortOrder=Asc&limit=100")).data
- for _, server in pairs(servers) do
- if server.playing > maxPlayersLimit and server.playing < server.maxPlayers then
- game:GetService("TeleportService"):TeleportToPlaceInstance(placeId, server.id)
- break
- end
- end
- end
- serverHop()
- end
Advertisement
Add Comment
Please, Sign In to add comment