ShoccessX

Untitled

Sep 10th, 2024 (edited)
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.02 KB | None | 0 0
  1. -- Place this script in StarterPlayerScripts or StarterGui
  2.  
  3. -- Configuration settings
  4. local Config = {
  5. EnableMovement = true,
  6. Xp = true,
  7. disableShooting = false,
  8. Multiplier = 100,
  9. AutoPlay = true,
  10. AutoShoot = true, -- Change this to false if you don't want auto shoot
  11. ChangeValue = 1,
  12. ServerPlayers = 10 -- Example value; adjust as needed
  13. }
  14.  
  15. local allowedPlaceIds = {
  16. [14269621394] = true,
  17. [15297128281] = true
  18. }
  19.  
  20. local teleportPlaceId = 15297128281
  21.  
  22. local player = game.Players.LocalPlayer
  23.  
  24. -- Check if the current PlaceId is allowed
  25. if not allowedPlaceIds[game.PlaceId] then
  26. print("Current PlaceId is not allowed. Teleporting to", teleportPlaceId)
  27. game:GetService("TeleportService"):Teleport(teleportPlaceId, player)
  28. return
  29. end
  30.  
  31. local args = {
  32. [1] = "Change Ready Settings",
  33. [2] = true
  34. }
  35.  
  36. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  37. local Remotes = ReplicatedStorage:WaitForChild("Remotes")
  38. local MainRE = Remotes:WaitForChild("Main.RE")
  39.  
  40. -- Existing logic
  41. if game.PlaceId == 15297128281 then
  42. print("In the correct place. Starting MainRE.")
  43. while true do
  44. MainRE:FireServer(unpack(args))
  45. wait(1)
  46. end
  47. else
  48. print("Not in the correct place. Current PlaceId:", game.PlaceId)
  49. end
  50.  
  51. local VirtualUser = game:GetService('VirtualUser')
  52. local StarterGui = game:GetService('StarterGui')
  53.  
  54. StarterGui:SetCore("SendNotification", { Title = "Anti-AFK", Text = "Script Activated", Duration = 5 })
  55.  
  56. player.Idled:Connect(function()
  57. VirtualUser:CaptureController()
  58. VirtualUser:ClickButton2(Vector2.new())
  59. end)
  60.  
  61. local function disableAFKCheck()
  62. local function disableScriptInGui(gui)
  63. local afkCheckScript = gui:FindFirstChild("AFK.Check")
  64. if afkCheckScript and afkCheckScript:IsA("LocalScript") then
  65. afkCheckScript.Disabled = true
  66. print("AFK.Check script in", gui.Name, "is disabled.")
  67. else
  68. print("AFK.Check script not found or not a LocalScript in", gui.Name, ".")
  69. end
  70. end
  71.  
  72. local starterGuiAFKUi = StarterGui:FindFirstChild("AFK.Ui")
  73. if starterGuiAFKUi then
  74. disableScriptInGui(starterGuiAFKUi)
  75. else
  76. print("AFK.Ui not found in StarterGui.")
  77. end
  78.  
  79. local playerGuiAFKUi = player.PlayerGui:FindFirstChild("AFK.Ui")
  80. if playerGuiAFKUi then
  81. disableScriptInGui(playerGuiAFKUi)
  82. else
  83. print("AFK.Ui not found in PlayerGui.")
  84. end
  85. end
  86.  
  87. disableAFKCheck()
  88.  
  89. local backpack = player:WaitForChild("Backpack")
  90. local actionValues = backpack:WaitForChild("ActionValues")
  91. local power = actionValues:WaitForChild("Power")
  92.  
  93. local function onPowerChanged()
  94. if power.Value >= Config.ChangeValue and Config.Xp and not Config.disableShooting then
  95. print("Power changed to", power.Value, "- preparing to shoot.")
  96. local args = {
  97. [1] = false,
  98. [2] = "Shooting",
  99. [3] = "Standing Shot"
  100. }
  101.  
  102. local shotMultiplier = Config.Multiplier
  103. local playerEvents = backpack:FindFirstChild("PlayerEvents") or ReplicatedStorage:FindFirstChild("PlayerEvents")
  104.  
  105. if playerEvents then
  106. local shootingEvent = playerEvents:FindFirstChild("Shooting")
  107. if shootingEvent then
  108. for i = 1, shotMultiplier do
  109. shootingEvent:FireServer(unpack(args))
  110. end
  111. print("Fired", shotMultiplier, "shots.")
  112. else
  113. warn("Shooting event not found in PlayerEvents.")
  114. end
  115. else
  116. warn("PlayerEvents folder not found in either Backpack or ReplicatedStorage.")
  117. end
  118. end
  119. end
  120.  
  121. power:GetPropertyChangedSignal("Value"):Connect(onPowerChanged)
  122.  
  123. local function disableShooting()
  124. Config.Xp = false
  125. Config.disableShooting = true
  126. Config.AutoPlay = false
  127. Config.AutoShoot = false
  128. print("Shooting and AutoPlay have been disabled as the warm-up is finished.")
  129. end
  130.  
  131. local gameValues = ReplicatedStorage:WaitForChild("GameValues")
  132. local warmupFinished = gameValues:WaitForChild("WarmupFinished")
  133.  
  134. if warmupFinished.Value == true then
  135. print("Warmup is finished!")
  136. disableShooting()
  137. else
  138. print("Warmup is not finished yet.")
  139. end
  140.  
  141. warmupFinished:GetPropertyChangedSignal("Value"):Connect(function()
  142. if warmupFinished.Value == true then
  143. print("Warmup is finished now!")
  144. disableShooting()
  145. end
  146. end)
  147.  
  148. local character = player.Character or player.CharacterAdded:Wait()
  149. local humanoid = character:WaitForChild("Humanoid")
  150.  
  151. local positions = {
  152. Vector3.new(21, 4, -433),
  153. Vector3.new(-47, 4, -434),
  154. Vector3.new(21, 4, -408),
  155. Vector3.new(-47, 4, -409)
  156. }
  157.  
  158. local hasShot = false
  159.  
  160. local function AutoShoot()
  161. if not Config.AutoShoot or warmupFinished.Value or hasShot then
  162. return
  163. end
  164.  
  165. local ball = workspace:FindFirstChild("Balls") and workspace.Balls:FindFirstChild("Ball")
  166. if ball then
  167. print("Player has the ball. Shooting...")
  168. wait(0.5)
  169.  
  170. local args = {
  171. [1] = true,
  172. [2] = "Shooting",
  173. [3] = "Standing Shot"
  174. }
  175. ReplicatedStorage:WaitForChild("PlayerEvents"):WaitForChild("Shooting"):FireServer(unpack(args))
  176.  
  177. hasShot = true
  178. print("Shot fired. AutoShoot will be disabled.")
  179. else
  180. print("Player does not have the ball.")
  181. end
  182. end
  183.  
  184. local function AutoPlay()
  185. while Config.AutoPlay do
  186. if warmupFinished.Value then
  187. print("Warm-up is finished. AutoPlay will not walk to positions.")
  188. return
  189. end
  190. walkToNearestPosition()
  191. wait(2)
  192. end
  193. end
  194.  
  195. function walkToNearestPosition()
  196. if game.PlaceId ~= 14269621394 then
  197. return
  198. end
  199.  
  200. if warmupFinished.Value then
  201. print("Warmup is finished. Cannot move to the positions.")
  202. return
  203. end
  204.  
  205. local playerPosition = character.HumanoidRootPart.Position
  206. local nearestPosition = nil
  207. local minDistance = math.huge
  208.  
  209. for _, pos in pairs(positions) do
  210. local distance = (pos - playerPosition).magnitude
  211. if distance < minDistance then
  212. nearestPosition = pos
  213. minDistance = distance
  214. end
  215. end
  216.  
  217. if nearestPosition and Config.EnableMovement then
  218. print("Moving to nearest position at: " .. tostring(nearestPosition))
  219. humanoid:MoveTo(nearestPosition)
  220.  
  221. local moveToConnection
  222. moveToConnection = humanoid.MoveToFinished:Connect(function(reached)
  223. if reached then
  224. if Config.AutoShoot and not warmupFinished.Value and not hasShot then
  225. AutoShoot()
  226. end
  227. else
  228. print("Failed to reach the position. Trying again...")
  229. humanoid:MoveTo(nearestPosition)
  230. end
  231. end)
  232. else
  233. print("No valid positions found or movement is disabled.")
  234. end
  235. end
  236.  
  237. if Config.AutoPlay then
  238. print("Starting AutoPlay...")
  239. AutoPlay()
  240. else
  241. print("AutoPlay is disabled.")
  242. end
  243.  
  244. if Config.AutoShoot and not warmupFinished.Value and not hasShot then
  245. print("Starting AutoShoot...")
  246. AutoShoot()
  247. else
  248. print("AutoShoot is disabled or has already shot.")
  249. end
  250.  
  251. local placeId = game.PlaceId
  252. local maxPlayersLimit = Config.ServerPlayers
  253.  
  254. if placeId == 15297128281 then
  255. local function serverHop()
  256. local HttpService = game:GetService("HttpService")
  257. local servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?sortOrder=Asc&limit=100")).data
  258. for _, server in pairs(servers) do
  259. if server.playing > maxPlayersLimit and server.playing < server.maxPlayers then
  260. game:GetService("TeleportService"):TeleportToPlaceInstance(placeId, server.id)
  261. break
  262. end
  263. end
  264. end
  265. serverHop()
  266. end
  267.  
Advertisement
Add Comment
Please, Sign In to add comment