Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- /$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$
- /$$__ $$ /$$__ $$ |__/ | $$ | $$ | $$
- | $$ \__/ /$$$$$$$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$$$$$ /$$ /$$| $$ | $$
- | $$$$$$ /$$_____/ |____ $$ /$$__ $$| $$$$$$$$ /$$_____//$$_____/| $$ /$$_____/|_ $$_/ | $$ /$$/| $$$$$$$$
- \____ $$| $$ /$$$$$$$| $$ \ $$| $$__ $$| $$$$$$| $$$$$$ | $$| $$$$$$ | $$ \ $$/$$/ |_____ $$
- /$$ \ $$| $$ /$$__ $$| $$ | $$| $$ | $$ \____ $$\____ $$| $$ \____ $$ | $$ /$$ \ $$$/ | $$
- | $$$$$$/| $$$$$$$| $$$$$$$| $$$$$$$/| $$ | $$ /$$$$$$$//$$$$$$$/| $$ /$$$$$$$/ | $$$$/ \ $/ | $$
- \______/ \_______/ \_______/| $$____/ |__/ |__/|_______/|_______/ |__/|_______/ \___/ \_/ |__/
- | $$
- | $$
- |__/
- ]]--
- --These can be edited--
- local toggable = {
- target = "Head",
- walls = false,
- chams = true,
- ffa = false,
- auto = false,
- triggerbot = false,
- enabled = true
- }
- --These can be edited--
- --Hotkeys--
- local keys = {
- target = Enum.KeyCode.F,
- walls = Enum.KeyCode.P,
- chams = Enum.KeyCode.H,
- ffa = Enum.KeyCode.K,
- auto = Enum.KeyCode.L,
- tiggerbot = Enum.KeyCode.V,
- enabled = Enum.KeyCode.E
- }
- --Hotkeys--
- --These can not--
- local lp = game.Players.LocalPlayer
- repeat wait(0.025) until lp.Character
- local lpc = lp.Character
- local camera = game.Workspace.CurrentCamera
- local mouse = lp:GetMouse()
- local mdown = false
- local chams = Instance.new("Folder")
- chams.Name = "ScapChams"
- chams.Parent = game.CoreGui
- --These can not--
- --Functions--
- function checkWalls(pos)
- if pos.Parent:FindFirstChild("HumanoidRootPart") and pos and lpc:FindFirstChild(toggable.target) then
- local hit = game.Workspace:FindPartOnRayWithIgnoreList(Ray.new(lpc.HumanoidRootPart.CFrame.p, (pos.Parent.HumanoidRootPart.CFrame.p-lpc.HumanoidRootPart.CFrame.p).unit*500), {camera, lpc, chams}, false, true)
- if hit.Name == pos.Name or hit.Name == "Head" or hit.Name == "HumanoidRootPart" or hit.Name == "Torso" or hit.Name == "UpperTorso" or hit.Name == "LowerTorso" or hit:IsDescendantOf(pos.Parent) then
- return true
- end
- return false
- end
- end
- function getReturn(v)
- if v ~= "none" then
- if v.Character:FindFirstChild(toggable.target) then
- if toggable.walls and v.Character:FindFirstChild(toggable.target) and lpc:FindFirstChild("HumanoidRootPart") then
- return v.Character[toggable.target].CFrame.p
- elseif checkWalls(v.Character[toggable.target]) and v.Character:FindFirstChild(toggable.target) and lpc:FindFirstChild("HumanoidRootPart") then
- return v.Character[toggable.target].CFrame.p
- end
- end
- end
- end
- function grabClosest()
- local mini = 21e8
- local closest = "none"
- for _,v in pairs(game.Players:GetChildren()) do
- if v.Name ~= lp.Name and lpc:FindFirstChild("HumanoidRootPart") and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
- if not toggable.walls and toggable.ffa and (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini then
- if checkWalls(v.Character[toggable.target]) then
- mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
- closest = v
- end
- elseif not toggable.walls and (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini and v.TeamColor ~= lp.TeamColor then
- if checkWalls(v.Character[toggable.target]) then
- mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
- closest = v
- end
- elseif toggable.ffa and (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini then
- mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
- closest = v
- elseif (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude < mini and v.TeamColor ~= lp.TeamColor then
- mini = (lpc.HumanoidRootPart.CFrame.p-v.Character.HumanoidRootPart.CFrame.p).magnitude
- closest = v
- end
- end
- end
- return getReturn(closest)
- end
- function grabColor(pos, plr)
- if toggable.ffa then
- return Color3.fromRGB(255, 0, 0)
- elseif plr.TeamColor == lp.TeamColor then
- return Color3.fromRGB(0, 255, 0)
- elseif plr.TeamColor ~= lp.TeamColor then
- return Color3.fromRGB(255, 0, 0)
- end
- end
- function createChams()
- chams:ClearAllChildren()
- for _,v in pairs(game.Players:GetChildren()) do
- if v.Name ~= lp.Name then
- if v.Character then
- for _,c in pairs(v.Character:GetChildren()) do
- if c:IsA("BasePart") then
- local cham = Instance.new("BoxHandleAdornment")
- cham.Name = "Cham"
- cham.Color3 = grabColor(c, v)
- cham.Adornee = c
- cham.Size = c.Size+Vector3.new(0.01, 0.01, 0.01)
- cham.AlwaysOnTop = true
- cham.ZIndex = 1
- cham.Parent = chams
- end
- end
- end
- end
- end
- end
- --Functions--
- --Main Framework--
- game:GetService("RunService").RenderStepped:connect(function()
- if toggable.enabled and mdown or toggable.enabled and toggable.auto then
- local closest = grabClosest()
- if closest then
- game:GetService("TweenService"):Create(camera, TweenInfo.new(0.065, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {CFrame = CFrame.new(camera.Focus.p, closest)*CFrame.new(0, 0, 0.5)}):Play()
- if not toggable.walls and toggable.triggerbot then
- mouse1press()
- wait()
- mouse1release()
- end
- end
- end
- end)
- game:GetService("UserInputService").InputBegan:connect(function(key)
- for i,v in pairs(keys) do
- if key.KeyCode == v then
- if type(toggable[i]) == "boolean" then
- toggable[i] = not toggable[i]
- if i == "chams" then
- if toggable[i] then
- createChams()
- else
- chams:ClearAllChildren()
- end
- end
- else
- if toggable[i] == "Head" then
- toggable[i] = "HumanoidRootPart"
- else
- toggable[i] = "Head"
- end
- end
- end
- end
- end)
- mouse.Button2Down:connect(function()
- mdown = true
- end)
- mouse.Button2Up:connect(function()
- mdown = false
- end)
- if toggable.chams then
- createChams()
- end
- game.Players.LocalPlayer.CharacterAdded:connect(function(char)
- wait(0.25)
- lpc = char
- if toggable.chams then
- createChams()
- end
- end)
- --Main Framework--
Add Comment
Please, Sign In to add comment