ShoccessX

whatdips

Sep 13th, 2024 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.50 KB | None | 0 0
  1. -- Place this script in StarterPlayerScripts or StarterCharacterScripts
  2.  
  3. -- List of allowed Place IDs
  4. local allowedPlaceIds = {
  5. [14269621394] = true,
  6. [15297128281] = true
  7. }
  8.  
  9. -- The Place ID to teleport to if the current Place ID is not allowed
  10. local teleportPlaceId = 15297128281
  11.  
  12. local currentPlaceId = game.PlaceId
  13.  
  14. if not allowedPlaceIds[currentPlaceId] then
  15. print("Current Place ID not allowed. Teleporting to Place ID", teleportPlaceId)
  16. game:GetService("TeleportService"):Teleport(teleportPlaceId)
  17. return
  18. end
  19.  
  20. -- Function to delete the specified paths
  21. local function deletePaths()
  22. local map = workspace:FindFirstChild("Map")
  23. if map then
  24. -- Delete Building
  25. local building = map:FindFirstChild("Building")
  26. if building then
  27. building:Destroy()
  28. print("Building deleted.")
  29. else
  30. print("Building not found.")
  31. end
  32.  
  33. -- Delete Fans
  34. local fans = map:FindFirstChild("Fans")
  35. if fans then
  36. fans:Destroy()
  37. print("Fans deleted.")
  38. else
  39. print("Fans not found.")
  40. end
  41.  
  42. -- Delete Banners
  43. local banners = map:FindFirstChild("Banners")
  44. if banners then
  45. banners:Destroy()
  46. print("Banners deleted.")
  47. else
  48. print("Banners not found.")
  49. end
  50.  
  51. -- Delete NeonLights
  52. local neonLights = map:FindFirstChild("NeonLights")
  53. if neonLights then
  54. neonLights:Destroy()
  55. print("NeonLights deleted.")
  56. else
  57. print("NeonLights not found.")
  58. end
  59. else
  60. print("Map not found.")
  61. end
  62. end
  63.  
  64. -- Call the function to delete the paths only if in the specified Place ID
  65. if currentPlaceId == 14269621394 then
  66. deletePaths()
  67. end
  68.  
  69. local player = game.Players.LocalPlayer
  70.  
  71. if player.Name ~= _G.PlayerData["Player1"] and player.Name ~= _G.PlayerData["Player2"] then
  72. print("Not the correct player. Current player:", player.Name)
  73. return
  74. end
  75.  
  76. local args = {
  77. [1] = "Change Ready Settings",
  78. [2] = true
  79. }
  80.  
  81. game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Main.RE"):FireServer(unpack(args))
  82.  
  83. if game.PlaceId == 15297128281 then
  84. print("In the correct place. Starting MainRE.")
  85. while true do
  86. MainRE:FireServer(unpack(args))
  87. wait(1)
  88. end
  89. else
  90. print("Not in the correct place. Current PlaceId:", game.PlaceId)
  91. end
  92.  
  93. local VirtualUser = game:GetService('VirtualUser')
  94. local StarterGui = game:GetService('StarterGui')
  95.  
  96. StarterGui:SetCore("SendNotification", { Title = "Anti-AFK", Text = "Script Activated", Duration = 5 })
  97.  
  98. player.Idled:Connect(function()
  99. VirtualUser:CaptureController()
  100. VirtualUser:ClickButton2(Vector2.new())
  101. end)
  102.  
  103. local function disableAFKCheck()
  104. local function disableScriptInGui(gui)
  105. local afkCheckScript = gui:FindFirstChild("AFK.Check")
  106. if afkCheckScript and afkCheckScript:IsA("LocalScript") then
  107. afkCheckScript.Disabled = true
  108. print("AFK.Check script in", gui.Name, "is disabled.")
  109. else
  110. print("AFK.Check script not found or not a LocalScript in", gui.Name, ".")
  111. end
  112. end
  113.  
  114. local starterGuiAFKUi = StarterGui:FindFirstChild("AFK.Ui")
  115. if starterGuiAFKUi then
  116. disableScriptInGui(starterGuiAFKUi)
  117. else
  118. print("AFK.Ui not found in StarterGui.")
  119. end
  120.  
  121. local playerGuiAFKUi = player.PlayerGui:FindFirstChild("AFK.Ui")
  122. if playerGuiAFKUi then
  123. disableScriptInGui(playerGuiAFKUi)
  124. else
  125. print("AFK.Ui not found in PlayerGui.")
  126. end
  127. end
  128.  
  129. disableAFKCheck()
  130.  
  131. local backpack = player:WaitForChild("Backpack")
  132. local actionValues = backpack:WaitForChild("ActionValues")
  133. local power = actionValues:WaitForChild("Power")
  134.  
  135. local function onPowerChanged()
  136. if power.Value >= _G.ChangeValue and _G.Xp and not _G.disableShooting then
  137. print("Power changed to", power.Value, "- preparing to shoot.")
  138. local args = {
  139. [1] = false,
  140. [2] = "Shooting",
  141. [3] = "Standing Shot"
  142. }
  143.  
  144. local shotMultiplier = _G.Multiplier
  145. local playerEvents = backpack:FindFirstChild("PlayerEvents") or ReplicatedStorage:FindFirstChild("PlayerEvents")
  146.  
  147. if playerEvents then
  148. local shootingEvent = playerEvents:FindFirstChild("Shooting")
  149. if shootingEvent then
  150. for i = 1, shotMultiplier do
  151. shootingEvent:FireServer(unpack(args))
  152. end
  153. print("Fired", shotMultiplier, "shots.")
  154. else
  155. warn("Shooting event not found in PlayerEvents.")
  156. end
  157. else
  158. warn("PlayerEvents folder not found in either Backpack or ReplicatedStorage.")
  159. end
  160. end
  161. end
  162.  
  163. local character = player.Character or player.CharacterAdded:Wait()
  164. local humanoid = character:WaitForChild("Humanoid")
  165. local rootPart = character:WaitForChild("HumanoidRootPart")
  166.  
  167. -- Define the possible target positions
  168. local possibleTargetPositions1 = {
  169. Vector3.new(21, 4, -433),
  170. Vector3.new(-47, 4, -434),
  171. Vector3.new(21, 4, -408),
  172. Vector3.new(-47, 4, -409)
  173. }
  174.  
  175. local possibleTargetPositions2 = {
  176. Vector3.new(-13, 3, -370),
  177. Vector3.new(-13, 3, -472)
  178. }
  179.  
  180. -- Function to find the nearest position
  181. local function getNearestPosition(positions)
  182. local closestPosition = nil
  183. local shortestDistance = math.huge
  184.  
  185. for _, position in ipairs(positions) do
  186. local distance = (rootPart.Position - position).magnitude
  187. if distance < shortestDistance then
  188. shortestDistance = distance
  189. closestPosition = position
  190. end
  191. end
  192.  
  193. return closestPosition
  194. end
  195.  
  196. -- Function to walk to a position
  197. local function walkToPosition(position)
  198. humanoid:MoveTo(position)
  199. humanoid.MoveToFinished:Wait()
  200. end
  201.  
  202. local function mainLoop()
  203. -- Get the nearest positions
  204. local targetPosition1 = getNearestPosition(possibleTargetPositions1)
  205. local targetPosition2 = getNearestPosition(possibleTargetPositions2)
  206.  
  207. -- Print the nearest positions for debugging
  208. print("Nearest Position 1: ", targetPosition1)
  209. print("Nearest Position 2: ", targetPosition2)
  210.  
  211. -- Check if positions are valid
  212. if not targetPosition1 or not targetPosition2 then
  213. print("Error: One or both target positions are invalid.")
  214. return
  215. end
  216.  
  217. wait(18)
  218.  
  219. -- Walk to the first target position and shoot
  220. walkToPosition(targetPosition1)
  221.  
  222. wait(6)
  223.  
  224. local args1 = {
  225. [1] = true,
  226. [2] = "Shooting",
  227. [3] = "Standing Shot"
  228. }
  229. ReplicatedStorage:WaitForChild("PlayerEvents"):WaitForChild("Shooting"):FireServer(unpack(args1))
  230.  
  231. -- Wait for 1 second
  232. wait(1)
  233.  
  234. -- Walk to the first target position again and shoot
  235. walkToPosition(targetPosition1)
  236.  
  237. wait(2)
  238.  
  239. local args2 = {
  240. [1] = true,
  241. [2] = "Shooting",
  242. [3] = "Standing Shot"
  243. }
  244. ReplicatedStorage:WaitForChild("PlayerEvents"):WaitForChild("Shooting"):FireServer(unpack(args2))
  245.  
  246. -- Wait for 1 second
  247. wait(1)
  248.  
  249. -- Walk to the first target position a third time and shoot
  250. walkToPosition(targetPosition1)
  251.  
  252. -- Wait for 1 second
  253. wait(1)
  254.  
  255. -- Walk to the second target position
  256. walkToPosition(targetPosition2)
  257. print("Reached the target position.")
  258.  
  259. wait(2)
  260.  
  261. local args4 = {
  262. [1] = true,
  263. [2] = "Shooting",
  264. [3] = "Layup"
  265. }
  266. ReplicatedStorage:WaitForChild("PlayerEvents"):WaitForChild("Shooting"):FireServer(unpack(args4))
  267.  
  268. print("Reached the target positions and completed the sequence.")
  269. end
  270.  
  271. -- Start the main loop
  272. mainLoop()
  273.  
  274. power:GetPropertyChangedSignal("Value"):Connect(onPowerChanged)
  275.  
  276. local function disableShooting()
  277. _G.Xp = false
  278. _G.disableShooting = true
  279. _G.AutoPlay = false
  280. _G.AutoShoot = false
  281. print("Shooting and AutoPlay have been disabled as the warm-up is finished.")
  282. end
  283.  
  284. local gameValues = ReplicatedStorage:WaitForChild("GameValues")
  285. local warmupFinished = gameValues:WaitForChild("WarmupFinished")
  286.  
  287. if warmupFinished.Value == true then
  288. print("Warmup is finished!")
  289. disableShooting()
  290. else
  291. print("Warmup is not finished yet.")
  292. end
  293.  
  294. warmupFinished:GetPropertyChangedSignal("Value"):Connect(function()
  295. if warmupFinished.Value == true then
  296. print("Warmup is finished now!")
  297. disableShooting()
  298. end
  299. end)
  300.  
  301. -- Ensure the script runs when the player character is added
  302. local player = game.Players.LocalPlayer
  303.  
  304. local function onCharacterAdded(character)
  305. local humanoid = character:WaitForChild("Humanoid")
  306. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  307.  
  308. -- Function to check the Z-coordinate for Team 1
  309. local function checkZCoordinateTeam1()
  310. while true do
  311. local zPos = humanoidRootPart.Position.Z
  312. if zPos < -421 then
  313. print("Team 1: Z-coordinate is less than -421. Waiting 25 seconds...")
  314. wait(25) -- Wait for 25 seconds
  315.  
  316. print("Team 1: Moving to (-61, 3, -400)...")
  317. -- Move the player to (-61, 3, -400) for Team 1
  318. humanoid:MoveTo(Vector3.new(-61, 3, -400))
  319.  
  320. local moveToConnection
  321. moveToConnection = humanoid.MoveToFinished:Connect(function(reached)
  322. if reached then
  323. print("Team 1: Successfully moved to (-61, 3, -400).")
  324. else
  325. print("Team 1: Failed to reach position, retrying...")
  326. humanoid:MoveTo(Vector3.new(-61, 3, -400))
  327. end
  328. moveToConnection:Disconnect()
  329. end)
  330. end
  331. wait(0.1) -- Check every 0.1 seconds
  332. end
  333. end
  334.  
  335. -- Function to check the Z-coordinate for Team 2
  336. local function checkZCoordinateTeam2()
  337. while true do
  338. local zPos = humanoidRootPart.Position.Z
  339. if zPos > -421 then
  340. print("Team 2: Z-coordinate is greater than -421. Waiting 25 seconds...")
  341. wait(25) -- Wait for 25 seconds
  342.  
  343. print("Team 2: Moving to (-61, 3, -435)...")
  344. -- Move the player to (-61, 3, -435) for Team 2
  345. humanoid:MoveTo(Vector3.new(-61, 3, -435))
  346.  
  347. local moveToConnection
  348. moveToConnection = humanoid.MoveToFinished:Connect(function(reached)
  349. if reached then
  350. print("Team 2: Successfully moved to (-61, 3, -435).")
  351. else
  352. print("Team 2: Failed to reach position, retrying...")
  353. humanoid:MoveTo(Vector3.new(-61, 3, -435))
  354. end
  355. moveToConnection:Disconnect()
  356. end)
  357. end
  358. wait(0.1) -- Check every 0.1 seconds
  359. end
  360. end
  361.  
  362. -- Check which team the player is on and run the respective logic
  363. if player.Team and player.Team.Name == "Team 1" then
  364. print("You are on Team 1.")
  365. checkZCoordinateTeam1()
  366. elseif player.Team and player.Team.Name == "Team 2" then
  367. print("You are on Team 2.")
  368. checkZCoordinateTeam2()
  369. else
  370. print("You are not on Team 1 or Team 2. Script will not run.")
  371. end
  372. end
  373.  
  374. -- Connect the function to CharacterAdded
  375. player.CharacterAdded:Connect(onCharacterAdded)
  376.  
  377. -- Handle the case when the character is already loaded
  378. if player.Character then
  379. onCharacterAdded(player.Character)
  380. end
  381.  
  382. local placeId = game.PlaceId
  383. local maxPlayersLimit = _G.ServerPlayers
  384.  
  385. if placeId == 15297128281 then
  386. local function serverHop()
  387. local HttpService = game:GetService("HttpService")
  388. local servers = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/" .. placeId .. "/servers/Public?sortOrder=Asc&limit=100")).data
  389. for _, server in pairs(servers) do
  390. if server.playing > maxPlayersLimit and server.playing < server.maxPlayers then
  391. game:GetService("TeleportService"):TeleportToPlaceInstance(placeId, server.id)
  392. break
  393. end
  394. end
  395. end
  396.  
  397. if #game.Players:GetPlayers() <= maxPlayersLimit then
  398. serverHop()
  399. end
  400. end
Advertisement
Add Comment
Please, Sign In to add comment