0% found this document useful (0 votes)
9 views2 pages

Message

The script monitors for specific 'Breach' parts in a game and teleports the player to them when found. It checks if the 'Breach' part has the correct color and a proximity prompt before executing a teleport and firing the prompt. The monitoring continues indefinitely, with a delay between checks to avoid rapid execution.

Uploaded by

HiroExT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Message

The script monitors for specific 'Breach' parts in a game and teleports the player to them when found. It checks if the 'Breach' part has the correct color and a proximity prompt before executing a teleport and firing the prompt. The monitoring continues indefinitely, with a delay between checks to avoid rapid execution.

Uploaded by

HiroExT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

if not game:IsLoaded() then

game.Loaded:Wait()
end

wait (5)

local Players = game:GetService("Players")


local RunService = game:GetService("RunService")
local GuiService = game:GetService("GuiService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

player.CharacterAdded:Connect(function(newCharacter)
character = newCharacter
end)

local function isCorrectBreach(part)


if not part:FindFirstChild("Breach") then return false end

local breach = part.Breach

if breach.BrickColor.Name == "Toothpaste" then


return true
else
return false
end
end

local function teleportAndFirePrompt(part)


if not part:FindFirstChild("Breach") then return false end
if not part.Breach:FindFirstChild("ProximityPrompt") then return false end
if not isCorrectBreach(part) then
return false
end

local prompt = part.Breach.ProximityPrompt


local humanoid = character:FindFirstChild("Humanoid")
local hrp = character:FindFirstChild("HumanoidRootPart")

if not humanoid or not hrp then


return false
end

local teleportPosition = part.Position + Vector3.new(0, 3, 0)


hrp.CFrame = CFrame.new(teleportPosition)

task.wait(0.5)

fireproximityprompt(prompt)

local success, err = pcall(function()


local breach = player:WaitForChild("PlayerGui"):WaitForChild("Breach")
local container = breach:WaitForChild("Frame"):GetChildren()[4]
local innerFrame = container:WaitForChild("Frame"):WaitForChild("Frame")
local targetButton = innerFrame:GetChildren()[2]:GetChildren()
[5].Frame:FindFirstChild("TextButton")

if targetButton and targetButton:IsA("TextButton") then


GuiService.SelectedObject = targetButton
task.delay(1, function()
local vim = game:GetService("VirtualInputManager")
vim:SendKeyEvent(true, Enum.KeyCode.Return, false, game)
vim:SendKeyEvent(false, Enum.KeyCode.Return, false, game)
end)
end
end)

return true
end

local function monitorBreaches()


if not workspace:FindFirstChild("Lobby") then
repeat task.wait(1) until workspace:FindFirstChild("Lobby")
end

if not workspace.Lobby:FindFirstChild("Breaches") then


repeat task.wait(1) until workspace.Lobby:FindFirstChild("Breaches")
end

local breachesFolder = workspace.Lobby.Breaches

while true do
for _, part in pairs(breachesFolder:GetChildren()) do
if part:IsA("BasePart") and part:FindFirstChild("Breach") then
if isCorrectBreach(part) then
local success = teleportAndFirePrompt(part)
if success then
task.wait(10)
end
end
end
end
task.wait(1)
end
end

spawn(function()
if not player.Character then
character = player.CharacterAdded:Wait()
task.wait(5)
end
monitorBreaches()
end)

You might also like