Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- or copy this loadstring(game:HttpGet("https://pastebin.com/raw/ZQZkLUz3",true))()
- --------------------------------------------------------------------------------
- --// Services
- --------------------------------------------------------------------------------
- local Players = game:GetService("Players")
- local Teams = game:GetService("Teams")
- local Workspace = game:GetService("Workspace")
- local TweenService = game:GetService("TweenService")
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local UserInputService = game:GetService("UserInputService")
- --------------------------------------------------------------------------------
- --// Locals & Globals
- --------------------------------------------------------------------------------
- local LocalPlayer = Players.LocalPlayer
- _G.ensureloop = true -- For billboard loop
- -- We'll store all connections here to clean them up on Kill
- local connections = {}
- local function bindConnection(signal, func)
- local connection = signal:Connect(func)
- table.insert(connections, connection)
- return connection
- end
- --// Infinite Stamina
- local stamina = game:GetService("Players").LocalPlayer.PlayerGui.Modules.Gameplay.Sprint.Stamina
- stamina.Value = math.huge
- staminaActive = true
- if staminaActive then
- bindConnection(stamina:GetPropertyChangedSignal("Value"), function()
- if stamina.Value ~= math.huge then
- stamina.Value = math.huge
- end
- end)
- end
- --------------------------------------------------------------------------------
- --// Create ScreenGui + Buttons + Labels
- --------------------------------------------------------------------------------
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "TaskGui"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = game:GetService("CoreGui")
- -- "Do Task" button
- local taskButton = Instance.new("TextButton")
- taskButton.Size = UDim2.new(0, 150, 0, 35)
- taskButton.Position = UDim2.new(0, 10, 0, 120)
- taskButton.Text = "Do Task"
- taskButton.Visible = false
- taskButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- taskButton.TextColor3 = Color3.new(1, 1, 1)
- taskButton.Font = Enum.Font.SourceSansBold
- taskButton.TextScaled = true
- taskButton.Parent = screenGui
- -- "Kill" button
- local killButton = Instance.new("TextButton")
- killButton.Size = UDim2.new(0, 150, 0, 35)
- killButton.Position = UDim2.new(0, 10, 0, 165)
- killButton.Text = "Kill"
- killButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- killButton.TextColor3 = Color3.new(1, 1, 1)
- killButton.Font = Enum.Font.SourceSansBold
- killButton.TextScaled = true
- killButton.Parent = screenGui
- -- Task prompt Label (also reused for error/status messages at the top)
- local taskPromptLabel = Instance.new("TextLabel")
- taskPromptLabel.Size = UDim2.new(1, 0, 0, 30)
- taskPromptLabel.Position = UDim2.new(0, 0, 0, 0)
- taskPromptLabel.BackgroundTransparency = 0.5
- taskPromptLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- taskPromptLabel.TextColor3 = Color3.new(1, 1, 1)
- taskPromptLabel.Font = Enum.Font.SourceSansBold
- taskPromptLabel.TextScaled = true
- taskPromptLabel.Text = ""
- taskPromptLabel.Visible = false
- taskPromptLabel.Parent = screenGui
- -- Watermark (rainbow)
- local watermark = Instance.new("TextLabel")
- watermark.Size = UDim2.new(0, 200, 0, 50)
- watermark.Position = UDim2.new(1, -210, 1, -60)
- watermark.BackgroundTransparency = 1
- watermark.Text = "KZscript"
- watermark.TextTransparency = 0.65
- watermark.TextScaled = true
- watermark.Font = Enum.Font.SourceSansBold
- watermark.Parent = screenGui
- local uiGradient = Instance.new("UIGradient")
- uiGradient.Parent = watermark
- uiGradient.Color = ColorSequence.new{
- ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
- ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 165, 0)),
- ColorSequenceKeypoint.new(0.33, Color3.fromRGB(255, 255, 0)),
- ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 0)),
- ColorSequenceKeypoint.new(0.67, Color3.fromRGB(0, 0, 255)),
- ColorSequenceKeypoint.new(0.83, Color3.fromRGB(75, 0, 130)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(238, 130, 238))
- }
- uiGradient.Rotation = 0
- --------------------------------------------------------------------------------
- --// Helper: Show a quick message at the top
- --------------------------------------------------------------------------------
- local function showMessage(msg, duration)
- taskPromptLabel.Text = msg
- taskPromptLabel.Visible = true
- task.wait(duration or 2)
- taskPromptLabel.Visible = false
- end
- --------------------------------------------------------------------------------
- --// Animate the Watermark Gradient
- --------------------------------------------------------------------------------
- local function animateGradient()
- local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, true)
- local goal = { Rotation = 360 }
- local tween = TweenService:Create(uiGradient, tweenInfo, goal)
- tween:Play()
- end
- animateGradient()
- --------------------------------------------------------------------------------
- --// Update "Do Task" Button Visibility
- --------------------------------------------------------------------------------
- local function updateButtonVisibility()
- -- Visible only if on the "Criminals" team
- if LocalPlayer.Team and LocalPlayer.Team.Name == "Criminals" then
- taskButton.Visible = true
- else
- taskButton.Visible = false
- end
- end
- bindConnection(LocalPlayer:GetPropertyChangedSignal("Team"), updateButtonVisibility)
- updateButtonVisibility()
- --------------------------------------------------------------------------------
- --// Do Task Logic
- --------------------------------------------------------------------------------
- local function executeTask()
- local playerModel = Workspace:FindFirstChild(LocalPlayer.Name)
- if not playerModel then
- warn("Player model not found in Workspace!")
- return
- end
- local oldTaskName = playerModel:GetAttribute("TaskName")
- if not oldTaskName or oldTaskName == "" or oldTaskName:match("^%s*$") then
- showMessage("No Tasks Wait", 3)
- return
- end
- -- Attempt to find the ProximityPrompt
- local promptFound
- local partToLookAt -- BasePart to aim the camera at
- for _, folder in ipairs(Workspace:GetChildren()) do
- if folder:IsA("Folder") then
- local tasksFolder = folder:FindFirstChild("Tasks")
- if tasksFolder then
- local taskModel = tasksFolder:FindFirstChild(oldTaskName)
- if taskModel and taskModel:IsA("Model") then
- local prompt = taskModel:FindFirstChildOfClass("ProximityPrompt")
- if prompt then
- promptFound = prompt
- -- If there's a "Hitbox" inside the model, use that
- local hitbox = taskModel:FindFirstChild("Hitbox")
- if hitbox and hitbox:IsA("BasePart") then
- partToLookAt = hitbox
- -- Otherwise use PrimaryPart if set
- elseif taskModel.PrimaryPart then
- partToLookAt = taskModel.PrimaryPart
- end
- break
- end
- end
- end
- end
- end
- -- We'll track when the TaskName changes or becomes empty
- local done = false
- local taskCheckConnection
- taskCheckConnection = bindConnection(playerModel:GetAttributeChangedSignal("TaskName"), function()
- local newTaskName = playerModel:GetAttribute("TaskName")
- if (newTaskName ~= oldTaskName and newTaskName ~= nil)
- or newTaskName == ""
- or newTaskName == " " then
- done = true
- end
- end)
- local function cleanupTaskCheck()
- if taskCheckConnection and taskCheckConnection.Connected then
- taskCheckConnection:Disconnect()
- end
- end
- if promptFound then
- -- 1) Point the camera at the found part (if any)
- local camera = Workspace.CurrentCamera
- local char = LocalPlayer.Character
- if char and char:FindFirstChild("Humanoid") then
- camera.CameraSubject = char:FindFirstChild("Humanoid")
- end
- if partToLookAt and partToLookAt:IsA("BasePart") then
- local camPos = camera.CFrame.Position
- local lookAt = partToLookAt.Position
- camera.CFrame = CFrame.new(camPos, lookAt)
- end
- -- 2) Set prompt properties
- promptFound.HoldDuration = 0
- promptFound.MaxActivationDistance = 1000
- -- 3) Attempt to manually hold E in a loop for up to 5 seconds
- local startTime = os.clock()
- while (os.clock() - startTime) < 5 and not done do
- for _, folder in ipairs(Workspace:GetChildren()) do
- if folder:IsA("Folder") then
- local tasksFolder = folder:FindFirstChild("Tasks")
- if tasksFolder then
- local taskModel = tasksFolder:FindFirstChild(oldTaskName)
- if taskModel and taskModel:IsA("Model") then
- local prompt = taskModel:FindFirstChildOfClass("ProximityPrompt")
- if prompt then
- fireproximityprompt(prompt)
- end
- end
- end
- end
- end
- task.wait(0.5)
- if done then break end
- task.wait(0.1)
- end
- if done then
- showMessage("Task Done!", 2)
- else
- taskPromptLabel.Text = "Try Manually - Look To Task Direction and Click E"
- taskPromptLabel.Visible = true
- task.wait(3)
- taskPromptLabel.Visible = false
- end
- cleanupTaskCheck()
- else
- showMessage("Couldn't find prompt for this task", 3)
- cleanupTaskCheck()
- end
- end
- taskButton.MouseButton1Click:Connect(executeTask)
- --------------------------------------------------------------------------------
- --// Billboard Creation (Team Labels / ESP)
- --------------------------------------------------------------------------------
- -- Real players have "TradeProximityPrompt" in their HRP
- local function createOrUpdateBillboard(player)
- if not _G.ensureloop then return end
- local char = player.Character
- if not char then return end
- local rootPart = char:FindFirstChild("HumanoidRootPart")
- if not rootPart then
- return
- end
- -- If there's NO "TradeProximityPrompt", skip => NPC
- if not rootPart:FindFirstChild("TradeProximityPrompt") then
- return
- end
- local head = char:FindFirstChild("Head")
- if not head then
- return
- end
- local billboardGui = head:FindFirstChild("PlayerBillboard")
- if not billboardGui then
- billboardGui = Instance.new("BillboardGui")
- billboardGui.Name = "PlayerBillboard"
- billboardGui.Size = UDim2.new(0, 200, 0, 50)
- billboardGui.StudsOffset = Vector3.new(0, 2, 0)
- billboardGui.AlwaysOnTop = true
- billboardGui.LightInfluence = 0
- billboardGui.MaxDistance = 200
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(1, 0, 1, 0)
- textLabel.BackgroundTransparency = 1
- textLabel.Text = "PLAYER!!"
- textLabel.TextColor3 = Color3.new(1, 1, 1)
- textLabel.TextScaled = true
- textLabel.Font = Enum.Font.SourceSansBold
- textLabel.Parent = billboardGui
- billboardGui.Parent = head
- end
- local textLabel = billboardGui:FindFirstChildOfClass("TextLabel")
- local function updateTeamText()
- if not _G.ensureloop then return end
- if player.Team == Teams:FindFirstChild("Sheriffs") then
- textLabel.Text = "Sheriff"
- textLabel.TextColor3 = Color3.fromRGB(0, 0, 255)
- elseif player.Team == Teams:FindFirstChild("Criminals") then
- textLabel.Text = "Criminal"
- textLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
- else
- textLabel.Text = "Neutral"
- textLabel.TextColor3 = Color3.new(1, 1, 1)
- end
- end
- -- Update label whenever their team changes
- bindConnection(player:GetPropertyChangedSignal("Team"), updateTeamText)
- updateTeamText()
- end
- --------------------------------------------------------------------------------
- --// Ensure Billboards for All Players
- --------------------------------------------------------------------------------
- local function ensureBillboards()
- for _, player in ipairs(Players:GetPlayers()) do
- createOrUpdateBillboard(player)
- end
- end
- ensureBillboards()
- local billboardCoroutine = coroutine.create(function()
- while _G.ensureloop do
- ensureBillboards()
- task.wait(5)
- end
- end)
- coroutine.resume(billboardCoroutine)
- bindConnection(Players.PlayerAdded, function(player)
- bindConnection(player.CharacterAdded, function()
- createOrUpdateBillboard(player)
- end)
- end)
- --------------------------------------------------------------------------------
- --// Wait for Target (Character + HumanoidRootPart)
- --------------------------------------------------------------------------------
- local function waitForCharacterAndHRP(plr, timeout)
- local startTime = os.clock()
- while not plr.Character and (os.clock() - startTime) < timeout do
- task.wait(0.1)
- end
- local char = plr.Character
- if not char then
- return nil
- end
- startTime = os.clock()
- while not char:FindFirstChild("HumanoidRootPart") and (os.clock() - startTime) < timeout do
- task.wait(0.1)
- end
- return char:FindFirstChild("HumanoidRootPart")
- end
- --------------------------------------------------------------------------------
- --// Kill All Changes
- --------------------------------------------------------------------------------
- local function killAllChanges()
- _G.ensureloop = false
- for _, c in ipairs(connections) do
- if c.Connected then
- c:Disconnect()
- end
- end
- staminaActive = false
- stamina.Value = 6
- -- Remove ScreenGui
- if screenGui then
- screenGui:Destroy()
- end
- -- Remove Billboards
- for _, player in ipairs(Players:GetPlayers()) do
- local c = player.Character
- if c and c:FindFirstChild("Head") then
- local billboard = c.Head:FindFirstChild("PlayerBillboard")
- if billboard then
- billboard:Destroy()
- end
- end
- end
- if watermark and watermark.Parent then
- watermark:Destroy()
- end
- end
- killButton.MouseButton1Click:Connect(killAllChanges)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement