Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local teleporting = false -- Variable to control teleportation
- -- Create the Screen GUI
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
- -- Create the Frame (Rainbow Box)
- local frame = Instance.new("Frame")
- frame.Parent = screenGui
- frame.Size = UDim2.new(0.2, 0, 0.2, 0)
- frame.Position = UDim2.new(0.4, 0, 0.4, 0)
- -- Create a Rainbow effect for the frame
- local function updateRainbow()
- local hue = tick() % 5 / 5
- frame.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
- end
- -- Run rainbow effect
- game:GetService("RunService").RenderStepped:Connect(updateRainbow)
- -- Create a TextBox for player input
- local playerInput = Instance.new("TextBox")
- playerInput.Parent = frame
- playerInput.Size = UDim2.new(0.9, 0, 0.3, 0)
- playerInput.Position = UDim2.new(0.05, 0, 0.1, 0)
- playerInput.PlaceholderText = "Enter Player Name"
- playerInput.TextScaled = true
- -- Create a Button to teleport
- local teleportButton = Instance.new("TextButton")
- teleportButton.Parent = frame
- teleportButton.Size = UDim2.new(0.9, 0, 0.3, 0)
- teleportButton.Position = UDim2.new(0.05, 0, 0.6, 0)
- teleportButton.Text = "Cheeze Them 😂"
- teleportButton.TextScaled = true
- -- Create a "Stop🧀" button to stop teleporting
- local stopButton = Instance.new("TextButton")
- stopButton.Parent = frame
- stopButton.Size = UDim2.new(0.9, 0, 0.3, 0)
- stopButton.Position = UDim2.new(0.05, 0, 0.9, 0)
- stopButton.Text = "Stop🧀"
- stopButton.TextScaled = true
- -- Create a "Kill GUI" button to delete the GUI
- local killGuiButton = Instance.new("TextButton")
- killGuiButton.Parent = screenGui
- killGuiButton.Size = UDim2.new(0.1, 0, 0.05, 0)
- killGuiButton.Position = UDim2.new(0.9, -10, 0, 10)
- killGuiButton.Text = "Kill GUI"
- killGuiButton.TextScaled = true
- -- Function to teleport behind a player
- local function teleportBehind(targetPlayer)
- local character = targetPlayer.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- local targetRoot = character.HumanoidRootPart
- local teleportPos = targetRoot.CFrame * CFrame.new(0, 0, 3) -- Teleport behind the player
- LocalPlayer.Character.HumanoidRootPart.CFrame = teleportPos
- end
- end
- -- Button click logic for teleporting
- teleportButton.MouseButton1Click:Connect(function()
- local targetName = playerInput.Text:lower() -- Convert input to lowercase for case-insensitivity
- local targetPlayer = nil
- -- Search for a player whose name contains the input
- for _, player in ipairs(Players:GetPlayers()) do
- if string.find(player.Name:lower(), targetName) then
- targetPlayer = player
- break
- end
- end
- if targetPlayer then
- teleporting = true -- Enable teleporting
- -- Loop teleport until the target dies or teleporting is stopped
- while targetPlayer.Character and targetPlayer.Character:FindFirstChild("Humanoid")
- and targetPlayer.Character.Humanoid.Health > 0 and teleporting do
- teleportBehind(targetPlayer)
- wait(0.1) -- Adjust this value for how fast the teleport happens
- end
- else
- print("Player not found!")
- end
- end)
- -- Stop button logic to stop teleporting
- stopButton.MouseButton1Click:Connect(function()
- teleporting = false -- Stop teleporting
- end)
- -- Kill GUI button logic
- killGuiButton.MouseButton1Click:Connect(function()
- screenGui:Destroy() -- Remove the GUI
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement