Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ver = 4.5
- local UIS = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local MoveMouse = mousemoverel or Input.MoveMouse or function() warn("ur executor is trash, aimbot won't work") end
- local Gui = Instance.new("ScreenGui",LocalPlayer.PlayerGui)
- local MouseDown = false
- local ActiveElement = nil
- local Aim = false
- local Theme = {PrimaryColor=Color3.fromRGB(255,200,0),SecondaryColor=Color3.fromRGB(50,50,50)}
- local MainMenu = {}
- function RoundToStep(Value,Step)
- local mod = (Value%Step)/Step
- local rounded = (mod>.5 and 1 or 0)
- return Value-(Value%Step)+rounded*Step
- end
- --Menu Classes
- local UIBase = {Edges={},Classes={}}
- local Label={Name=""}
- local Bool={}
- local Separator={}
- local Slider={}
- local SliderLabel={}
- local Color={}
- local ColorPicker={}
- local DropDown={}
- local Menu={}
- do
- function UIBase.new(Owner)
- local self = {}
- setmetatable(self,{__index=UIBase})
- self.Owner = Owner
- self.Classes["UIBase"] = true
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0,200,0,20)
- Frame.BackgroundColor3 = Theme.SecondaryColor
- Frame.BorderSizePixel = 0
- Frame.BackgroundTransparency = .2
- Frame.ClipsDescendants = false
- Frame.Name="BG"
- Frame.Parent = self.Owner and self.Owner.ClippingFrame or Gui
- local hr = Instance.new("Frame")
- hr.AnchorPoint=Vector2.new(.5,.5)
- hr.Position=UDim2.new(.5,0,0,0)
- hr.Size=UDim2.new(1,0,0,1)
- hr.BackgroundColor3=Theme.PrimaryColor
- hr.BorderSizePixel=0
- hr.Parent = Frame
- local top = hr
- local bottom = top:Clone()
- bottom.Position = UDim2.new(.5,0,1,-1)
- bottom.Parent = Frame
- local vr = Instance.new("Frame")
- vr.AnchorPoint=Vector2.new(.5,.5)
- vr.Position=UDim2.new(0,0,.5,0)
- vr.Size=UDim2.new(0,1,1,0)
- vr.BackgroundColor3=Theme.PrimaryColor
- vr.BorderSizePixel=0
- vr.Parent = Frame
- local left = vr
- local right = left:Clone()
- right.Position = UDim2.new(1,-1,.5,0)
- right.Parent = Frame
- self.Edges = {left,top,right,bottom}
- self.BG = Frame
- if self.Owner and Owner.LastChild then
- top.Visible = false
- Owner.LastChild.Edges[4].Size = UDim2.new(1,-20,0,1)
- end
- return self
- end
- function UIBase:IsA(className)
- return self.Classes["UIBase"]
- end
- setmetatable(Label,{__index=UIBase})
- function Label.new(Owner,Name)
- local self = UIBase.new(Owner)
- setmetatable(self,{__index=Label})
- --SUPER
- self.Classes["Label"]=true
- self.Name=Name or self.Name
- --text
- local Label=Instance.new("TextLabel")
- Label.Size=UDim2.new(0,150,0,20)
- Label.BackgroundColor3=Color3.fromRGB(50,50,50)
- Label.BorderSizePixel=0
- Label.BackgroundTransparency=1
- Label.Text=Name or "Bool"
- Label.TextColor3=Theme.PrimaryColor
- Label.TextXAlignment=Enum.TextXAlignment.Left
- Label.TextSize=10
- Label.Position=UDim2.new(0,10,0,0)
- Label.Parent=self.BG
- self.Label=Label
- return self
- end
- setmetatable(Separator,{__index=UIBase})
- function Separator.new(Owner)
- local self = UIBase.new(Owner,"")
- setmetatable(self,{__index=Separator})
- --SUPER
- self.Classes["Separator"]=true
- return self
- end
- setmetatable(Bool,{__index=Label})
- function Bool.new(Owner,Name,Value)
- local self=Label.new(Owner,Name)
- setmetatable(self,{__index=Bool})
- --SUPER INIT
- self.Classes["Bool"]=true
- self.Classes["Label"]=false --hide label inheritance cos that's gonna cause some awkward behaviours for devs using the library
- self._Value=Value
- self.ValueChanged=Instance.new("BindableEvent")
- --checkbox
- local Box=Instance.new("TextButton")
- Box.Size=UDim2.new(0,10,0,10)
- Box.Position=UDim2.new(1,-26,0,10)
- Box.AnchorPoint=Vector2.new(0,.5)
- Box.BorderSizePixel=0
- Box.Text=""
- Box.BackgroundColor3=Value and Color3.new(0,1,0) or Color3.new(1,0,0)
- Box.AutoButtonColor=false
- Box.MouseButton1Click:Connect(function()
- self:SetValue(not self._Value)
- ActiveElement=self
- end)
- Box.Parent=self.BG
- self.Box=Box
- return self
- end
- function Bool:SetValue(Value)
- self.ValueChanged:Fire(Value)
- self._Value=Value
- self.Box.BackgroundColor3=Value and Color3.new(0,1,0) or Color3.new(1,0,0)
- end
- function Bool:GetValue()
- return self._Value
- end
- setmetatable(Slider,{__index=Label})
- function Slider.new(Owner,Name,Min,Max,Value,Step)
- local self = Label.new(Owner,Name)
- setmetatable(self,{__index=Slider})
- --SUPER INIT
- Value = math.clamp(Value,Min,Max)
- self.Classes["Slider"]=true
- self.Classes["Label"]=false--same gig
- self.Min=Min or 0
- self.Max=Max or 10
- self.Step=Step or 1
- self._Value=RoundToStep(Value or (self.Min+self.Max)/2,self.Step)
- self.ValueChanged=Instance.new("BindableEvent")
- --sliderail
- local f = Instance.new("Frame")
- f.Size = UDim2.new(0,70,0,5)
- f.AnchorPoint=Vector2.new(0,.5)
- f.Position=UDim2.new(0,110,.5,0)
- f.BorderSizePixel=0
- f.BackgroundColor3=Color3.new(.8,.8,.8)
- f.Parent=self.BG
- self.Rail=f
- --slidenotch
- local n = Instance.new("Frame")
- n.Size=UDim2.new(0,5,0,10)
- n.AnchorPoint=Vector2.new(.5,.5)
- n.Position=UDim2.new(0,0,.5,0)
- n.BorderSizePixel=0
- n.BackgroundColor3=Color3.new(1,1,1)
- n.Parent=f
- self.Notch=n
- --clicklistener
- local b = Instance.new("TextButton")
- b.Text=""
- b.Size=UDim2.new(0,70,0,20)
- b.ZIndex=2
- b.Position=UDim2.new(0,0,0,-8)
- b.BackgroundTransparency=1
- b.Parent=f
- b.MouseButton1Down:Connect(function()
- ActiveElement = self
- end)
- b.MouseButton1Up:Connect(function()
- if ActiveElement==self then
- ActiveElement=nil
- end
- end)
- self.Button=b
- self:SetValue(Value)
- return self
- end
- function Slider:SetValue(Value)
- self.ValueChanged:Fire(Value)
- self._Value=Value
- local k = (self._Value-self.Min)/(self.Max-self.Min)
- self.Notch.Position=UDim2.new(k,0,.5,0)
- end
- function Slider:GetValue()
- return self._Value
- end
- setmetatable(SliderLabel,{__index=Label})
- function SliderLabel.new(Owner,Slider)
- local self = Label.new(Owner,Slider:GetValue())
- setmetatable(self,{__index=SliderLabel})
- --SUPER INIT
- Slider.ValueChanged.Event:Connect(function(NewValue)
- self.Label.Text=NewValue
- end)
- return self
- end
- setmetatable(Color,{__index=UIBase})
- function Color.new(Owner,Value)
- local self = UIBase.new(Owner)
- setmetatable(self,{__index=Color})
- --SUPER INIT
- self._Value = Value or Color3.new(1,1,1)
- self.ValueChanged=Instance.new("BindableEvent")
- --indicator
- local f = Instance.new("Frame")
- f.Size = UDim2.new(0,14,0,14)
- f.AnchorPoint = Vector2.new(.5,.5)
- f.Position=UDim2.new(.5,0,.5,0)
- f.BorderSizePixel = 0
- f.BackgroundTransparency=0
- f.BackgroundColor3=Value
- f.Parent = self.BG
- self.Indicator=f
- return self
- end
- function Color:SetValue(Value)
- self._Value=Value
- self.ValueChanged:Fire(Value)
- self.Indicator.BackgroundColor3=Value
- end
- function Color:GetValue()
- return self._Value
- end
- setmetatable(ColorPicker,{__index=Menu})
- function ColorPicker.new(Owner,Name,Value)
- local self = Menu.new(Owner,Name)
- setmetatable(self,{__index=ColorPicker})
- --SUPER INIT
- self.Arrow:Destroy()
- self._Value = Value or Color3.new(1,1,1)
- self.ValueChanged=Instance.new("BindableEvent")
- --indicator
- local f = Instance.new("Frame")
- f.Size = UDim2.new(0,14,0,14)
- f.AnchorPoint = Vector2.new(.5,.5)
- f.Position=UDim2.new(1,-21,.5,0)
- f.BorderSizePixel = 0
- f.BackgroundTransparency=0
- f.BackgroundColor3=Value
- f.Parent = self.BG
- self.Indicator=f
- local indicator = self:AddColorIndicator(Value)
- local red = self:AddSlider("Red",0,1,Value.R,.01)
- red.ValueChanged.Event:Connect(function(NewValue)
- self._Value=Color3.new(NewValue,self._Value.G,self._Value.B)
- self.ValueChanged:Fire(self._Value)
- end)
- self.RedSlider = red
- local green = self:AddSlider("Green",0,1,Value.G,.01)
- green.ValueChanged.Event:Connect(function(NewValue)
- self._Value=Color3.new(self._Value.R,NewValue,self._Value.B)
- self.ValueChanged:Fire(self._Value)
- end)
- self.GreenSlider = green
- local blue = self:AddSlider("Blue",0,1,Value.B,.01)
- blue.ValueChanged.Event:Connect(function(NewValue)
- self._Value=Color3.new(self._Value.R,self._Value.G,NewValue)
- self.ValueChanged:Fire(self._Value)
- end)
- self.BlueSlider = blue
- self.ValueChanged.Event:Connect(function(NewValue)
- indicator:SetValue(NewValue)
- f.BackgroundColor3=NewValue
- end)
- return self
- end
- function ColorPicker:SetValue(Value)
- self._Value=Value
- self.ValueChanged.Event:Fire(Value)
- self.RedSlider:SetValue(Value.R)
- self.GreenSlider:SetValue(Value.G)
- self.BlueSlider:SetValue(Value.B)
- end
- function ColorPicker:GetValue()
- return self._Value
- end
- setmetatable(DropDown, {__index=UIBase})
- function DropDown.new(Owner,...)
- local self = UIBase.new(Owner)
- setmetatable(self,{__index=DropDown})
- --SUPERI NIT
- self.Classes["DropDown"]=true
- local args = {...}
- --TextButton
- local Button=Instance.new("TextButton")
- Button.Size=UDim2.new(0,200,0,20)
- Button.Position=UDim2.new(0,0,0,0)
- Button.BackgroundTransparency=1
- Button.TextSize=10
- Button.Text=args[1]
- Button.TextColor3=Theme.PrimaryColor
- Button.Parent=self.BG
- self.Button=Button
- --Clipping
- local Clipping=Instance.new("Frame")
- Clipping.Size=UDim2.new(0,200,0,20)
- Clipping.Position=UDim2.new(0,0,1,0)
- Clipping.BackgroundTransparency=1
- Clipping.ClipsDescendants=true
- Clipping.Parent=nil
- self.Clipping=Clipping
- Instance.new("UIListLayout",Clipping)
- for i=1,#args do
- local b = Button:Clone()
- b.Text=args[i]
- b.LayoutOrder=i
- b.BorderColor3=Theme.PrimaryColor
- b.BackgroundTransparency=0
- b.BackgroundColor3=Theme.SecondaryColor
- b.Parent=Clipping
- b.MouseButton1Click:Connect(function()
- self.Button.Text=args[i]
- self:Close()
- end)
- end
- self.args=args
- self.Button.MouseButton1Click:Connect(function()
- if self.Clipping.Size.Y.Offset > 20 then
- self:Close()
- else
- self:Open()
- end
- end)
- self.BG.Parent=Clipping
- self.BG=Clipping
- self.Clipping.Parent = Owner.ClippingFrame
- return self
- end
- function DropDown:Open()
- local Tween = TweenService:Create(
- self.Clipping,
- TweenInfo.new(
- .2,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- ),
- {
- Size=UDim2.new(0,200,0,(#self.args+1)*20),
- }
- )
- Tween:Play()
- end
- function DropDown:Close()
- local Tween = TweenService:Create(
- self.Clipping,
- TweenInfo.new(
- .2,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- ),
- {
- Size=UDim2.new(0,200,0,20),
- }
- )
- Tween:Play()
- end
- function DropDown:GetValue()
- return self.Button.Text
- end
- setmetatable(Menu,{__index=Label})
- function Menu.new(Owner,Name)
- local self = Label.new(Owner,Name)
- setmetatable(self,{__index=Menu})
- --SUPER INIT
- self.Classes["Menu"]=true
- self.Classes["Label"]=false --hide label inheritance cos that's just weird to have
- self.Children = {}
- self.State="Closed"
- self.Owner=Owner or nil
- self.LastChild=nil
- --arrow
- local Arrow=Instance.new("TextLabel")
- Arrow.Size=UDim2.new(0,20,0,20)
- Arrow.BackgroundTransparency=1
- Arrow.Text=">"
- Arrow.TextColor3=Theme.PrimaryColor
- Arrow.TextSize=10
- Arrow.Position=UDim2.new(1,-30,0,0)
- Arrow.Parent=self.BG
- self.Arrow=Arrow
- --click catcher
- local Button = Instance.new("TextButton")
- Button.Size = UDim2.new(0,200,0,20)
- Button.BackgroundColor3 = Color3.fromRGB(50,50,50)
- Button.BorderSizePixel=0
- Button.BackgroundTransparency=1
- Button.ZIndex=2
- Button.Text=""
- Button.MouseButton1Click:Connect(function()
- if self.State=="Closed" then
- self:Open()
- else
- self:Close()
- end
- end)
- Button.Parent = self.BG
- self.Button=Button
- --clipping rect
- local Frame = Instance.new("Frame")
- Frame.Size = UDim2.new(0,200,0,0)
- Frame.BackgroundColor3 = Color3.fromRGB(50,50,50)
- Frame.BorderSizePixel=0
- Frame.BackgroundTransparency=1
- Frame.ClipsDescendants = true
- Frame.Parent = Gui
- Frame.Position = self.Owner and self.Owner.ClippingFrame.Position+UDim2.new(0,200,0,0) or self.BG.Position+UDim2.new(0,200,0,0)
- Frame.Name="Clipping"
- self.ClippingFrame = Frame
- local Order = Instance.new("UIListLayout")
- Order.SortOrder=Enum.SortOrder.LayoutOrder
- Order.Parent=self.ClippingFrame
- return self
- end
- function Menu:Open()
- if self.Owner then
- for i,v in pairs(self.Owner.Children) do
- if v.Close then v:Close() end
- end
- end
- local Tween = TweenService:Create(
- self.ClippingFrame,
- TweenInfo.new(
- .2,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- ),
- {
- Size=UDim2.new(0,200,1,20*#self.Children),
- Visible=true
- }
- )
- self.ClippingFrame.Visible = true
- Tween:Play()
- self.State="Open"
- end
- function Menu:Close()
- for i,v in pairs(self.Children) do
- if v.Close then
- v:Close()
- end
- end
- local Tween = TweenService:Create(
- self.ClippingFrame,
- TweenInfo.new(
- .2,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- ),
- {
- Size=UDim2.new(0,200,0,0),
- Visible=false
- }
- )
- Tween:Play()
- self.State="Closed"
- end
- function Menu:_AddChild(Child)
- Child.BG.LayoutOrder = #self.Children
- table.insert(self.Children,Child)
- self.LastChild=Child
- end
- function Menu:AddSubMenu(Name)
- local m = Menu.new(self,Name)
- m.ClippingFrame.Position=self.ClippingFrame.Position+UDim2.new(0,200,0,0)
- self:_AddChild(m)
- return m
- end
- function Menu:AddLabel(Name)
- local l = Label.new(self,Name)
- self:_AddChild(l)
- return l
- end
- function Menu:AddBool(Name,Value)
- local b = Bool.new(self,Name,Value)
- self:_AddChild(b)
- return b
- end
- function Menu:AddSlider(Name,Min,Max,Value,Step)
- local s = Slider.new(self,Name,Min,Max,Value,Step)
- self:_AddChild(s)
- return s
- end
- function Menu:AddSliderLabel(Slider)
- local sl = SliderLabel.new(self,Slider)
- self:_AddChild(sl)
- return sl
- end
- function Menu:AddColorIndicator(Value)
- local c = Color.new(self,Value)
- self:_AddChild(c)
- return c
- end
- function Menu:AddColorPicker(Name,Value)
- local cp = ColorPicker.new(self,Name,Value)
- self:_AddChild(cp)
- return cp
- end
- function Menu:AddDropDown(...)
- local args={...}
- local dd = DropDown.new(self,unpack(args))
- self:_AddChild(dd)
- return dd
- end
- --menu functionality hooks
- UIS.InputBegan:Connect(function(Input,Processed)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- MouseDown=true
- elseif Input.UserInputType == Enum.UserInputType.MouseButton2 then
- Aim = true
- elseif Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode == Enum.KeyCode.Insert then
- if MainMenu.BG.Visible then
- MainMenu:Close()
- MainMenu.BG.Visible=false
- else
- MainMenu.BG.Visible=true
- end
- end
- end)
- UIS.InputEnded:Connect(function(Input,Processed)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- MouseDown=false
- ActiveElement=nil
- elseif Input.UserInputType == Enum.UserInputType.MouseButton2 then
- Aim = false
- end
- end)
- local mouse = LocalPlayer:GetMouse()
- game:GetService("RunService").RenderStepped:Connect(function(dT)
- if MouseDown and ActiveElement then
- if ActiveElement:IsA("Slider") then
- local mX = mouse.X
- local dX = mX-ActiveElement.Rail.AbsolutePosition.X
- local Frac = dX/ActiveElement.Rail.AbsoluteSize.X
- Frac=math.clamp(Frac,0,1)
- local RoughValue = ActiveElement.Min + (ActiveElement.Max-ActiveElement.Min)*Frac
- local Value = RoundToStep(RoughValue,ActiveElement.Step)
- ActiveElement:SetValue(Value)
- end
- end
- end)
- end
- --MENU SOURCE CODE
- local m = Menu.new(nil,"PFMaster "..ver)
- local ESPMenu = m:AddSubMenu("ESP")
- local ESPEnabled = ESPMenu:AddBool("Enabled",true)
- local EnemyColor = ESPMenu:AddColorPicker("Enemy Color",Color3.new(1,0,0))
- local FriendlyColor = ESPMenu:AddColorPicker("Friendly Color",Color3.new(0,1,0))
- local VisibleColor = ESPMenu:AddColorPicker("Enemy Visible Color",Color3.new(1,.588,0))
- local ESPTransparency = ESPMenu:AddSlider("Transparency",0,1,.5,.01)
- ESPMenu:AddSliderLabel(ESPTransparency)
- local ESPRate = ESPMenu:AddSlider("TickRate",3,30,20,1)
- ESPMenu:AddSliderLabel(ESPRate)
- local AimbotMenu = m:AddSubMenu("Aimbot")
- local AimbotEnabled = AimbotMenu:AddBool("Enabled",true)
- local AimSens = AimbotMenu:AddSlider("Speed",0,1.5,1,.01)
- AimbotMenu:AddSliderLabel(AimSens)
- local AimbotCalcDrop = AimbotMenu:AddBool("Calculate drop",true)
- local AimbotCalcMovement = AimbotMenu:AddBool("Calculate movement",true)
- AimbotMenu:AddLabel("Aim Bone")
- local AimBone = AimbotMenu:AddDropDown("Head","Torso","Left Arm","Right Arm")
- local AimLimit = AimbotMenu:AddSlider("Max Angle",15,180,180,5)
- AimbotMenu:AddSliderLabel(AimLimit)
- local HackMenu = m:AddSubMenu("Hacks")
- local NoSpread = HackMenu:AddBool("No Spread",false)
- local NoRecoil = HackMenu:AddBool("No Recoil",false)
- local FastReload = HackMenu:AddBool("Instant Reload",false)
- local RapidFire = HackMenu:AddBool("Rapid Fire",false)
- local FireRate = HackMenu:AddSlider("Fire Rate",300,1200,600,25)
- HackMenu:AddSliderLabel(FireRate)
- local NoSway = HackMenu:AddBool("No Sway",false)
- local NoFlash = HackMenu:AddBool("No Flash",false)
- local InstantAim = HackMenu:AddBool("Instant Aim")
- local MoveSpeed = HackMenu:AddBool("SpeedHack",false)
- local MoveSlider = HackMenu:AddSlider("Speed",10,40,20,1)
- HackMenu:AddSliderLabel(MoveSlider)
- m:AddLabel("PFMaster v"..ver.." by Fret")
- m:AddLabel("Built with MasterGui v1.0")
- MainMenu=m
- local CamWrapper = {}
- CamWrapper.cam = workspace.CurrentCamera
- function CamWrapper:CanSee(Part)
- local Ray=Ray.new(self.cam.CFrame.p,(Part.Position-self.cam.CFrame.p)*1.1)
- local Ignore = {LocalPlayer.Character,self.cam}
- local part=workspace:FindPartOnRayWithIgnoreList(Ray,Ignore)
- return part==Part or not part
- end
- function CamWrapper:CamAngleTo(Position)
- local lookVec = self.cam.CFrame.LookVector
- local dVec = (Position-self.cam.CFrame.p).unit
- return math.acos(lookVec:Dot(dVec))
- end
- function CamWrapper:Update()
- self.cam=workspace.CurrentCamera
- end
- local Delayed={}
- function DelayAction(Action,t)
- Delayed[tick()+t]=Action
- end
- function DelayEvaluate()
- for i,v in pairs(Delayed) do
- if tick()>i then
- v()
- Delayed[i]=nil
- end
- end
- end
- local activeslot = 1
- local bulletspeeds = {[1]=2000}--default assume 2k mvel
- local PrimaryTypes = {
- ["ASSAULT"]=true,
- ["SNIPER"]=true,
- ["PDW"]=true,
- ["DMR"]=true,
- ["BATTLE"]=true,
- ["CARBINE"]=true,
- ["SHOTGUN"]=true,
- ["LMG"]=true
- }
- local HackManager = {}
- function HackManager:Load()
- for i,v in pairs(getgc()) do
- if type(v) == "table" then
- if rawget(v,"addgun") then
- self.char = v
- print("foundchar")
- elseif rawget(v,"send") then
- self.networking = v
- print("foundnetworking")
- end
- end
- end
- if not self.char then
- warn("failed to find char")
- print("FIND CHAR ATTEMPT#2")
- local found = false
- for i,v in pairs(getgc()) do
- if type(v)=="function" and islclosure(v) then
- for _,upvalue in pairs(debug.getupvalues(v)) do
- if type(upvalue)==type({}) and (rawget(upvalue,"addgun") or rawget(upvalue,"loadgrenade")) then
- self.char = upvalue
- print("foundchar")
- found=true
- break
- end
- end
- if found then break end
- end
- end
- end
- self.OldLoadGun = self.char.addgun
- self.char.addgun = function(gundatawrapper)
- local GunData = gundatawrapper.data
- if PrimaryTypes[GunData.type] then
- --bulletspeed = GunData.bulletspeed
- bulletspeeds[activeslot]=GunData.bulletspeed
- print("SETBULLETSPEED",GunData.bulletspeed)
- end
- if NoSpread:GetValue() then
- GunData.hipfirespread = 0
- GunData.hipfirestability = 0
- GunData.hipfirerecovery = 100
- end
- if NoRecoil:GetValue() then
- for i,v in pairs(GunData) do
- if i:lower():find("kick") and not i:lower():find("speed") and type(v)=="userdata" then
- GunData[i]=v.unit*1/1000
- end
- end
- end
- if FastReload:GetValue() then
- for i,v in pairs(GunData.animations) do
- if i:lower():find("reload") or i:lower():find("pullbolt") or i:lower():find("onfire") then
- v.timescale=0
- end
- end
- end
- if RapidFire:GetValue() then
- GunData.firerate = FireRate:GetValue()
- GunData.variablefirerate = false
- GunData.firemodes = {true}
- GunData.requirechamber = false
- end
- if NoSway:GetValue() then
- GunData.swayamp=0
- GunData.swayspeed=0
- GunData.steadyspeed=0
- GunData.breathspeed=0
- end
- if NoFlash:GetValue() then
- GunData.hideflash=true
- GunData.hideminimap=true
- end
- if InstantAim:GetValue() then
- GunData.aimspeed = 100
- GunData.magnifyspeed = 100
- end
- if MoveSpeed:GetValue() then
- GunData.walkspeed = MoveSlider:GetValue()
- end
- return self.OldLoadGun(gundatawrapper)
- end
- end
- HackManager:Load()
- local ESP = {}
- ESP.LastRay = 0
- ESP.Characters = {}
- ESP.GlowInstances = {}
- ESP.GUIs={}
- ESP.GlowStringHash={
- Enemy=false,
- Friendly=true
- }
- function ESP:Load()
- self.Enabled = ESPEnabled:GetValue()
- ESPEnabled.ValueChanged.Event:Connect(function(Value)
- self.Enabled = Value
- if not Value then
- self.Characters = {}
- for Character,InstanceTable in pairs(self.GlowInstances) do
- for _,Glow in pairs(InstanceTable) do
- Glow:Destroy()
- end
- end
- self.GlowInstances={}
- --clean up tables
- end
- end)
- self.EnemyColor=EnemyColor:GetValue()
- EnemyColor.ValueChanged.Event:Connect(function(Value)
- self.EnemyColor=Value
- self:DoGlowColors("Enemy")
- end)
- self.FriendlyColor=FriendlyColor:GetValue()
- FriendlyColor.ValueChanged.Event:Connect(function(Value)
- self.FriendlyColor=Value
- self:DoGlowColors("Friendly")
- end)
- self.VisibleColor=VisibleColor:GetValue()
- VisibleColor.ValueChanged.Event:Connect(function(Value)
- self.VisibleColor=Value
- self:DoGlowColors("Enemy")
- end)
- self.GlowTransparency = ESPTransparency:GetValue()
- ESPTransparency.ValueChanged.Event:Connect(function(Value)
- self.GlowTransparency=Value
- self:DoGlowTransparency()
- end)
- end
- function ESP:DoGlowTransparency()
- for Character,GlowTable in pairs(self.GlowInstances) do
- for _,GlowObj in pairs(GlowTable) do
- GlowObj.Transparency = self.GlowTransparency
- end
- end
- end
- function ESP:CalculateColor(Player,Part)
- return Player.Team==LocalPlayer.Team and self.FriendlyColor or (CamWrapper:CanSee(Part) and self.VisibleColor or self.EnemyColor)
- end
- function ESP:TickPlayer(Player,Character)
- local Glows = self.GlowInstances[Character]
- if not Glows then return end
- for i,v in pairs(Glows) do
- v.Color3 = self:CalculateColor(Player,v.Adornee)
- end
- end
- function ESP:DoGlowColors(HashInput)
- local HashInputValue = self.GlowStringHash[HashInput]
- for Player,Character in pairs(self.Characters) do
- if (Player.Team==LocalPlayer.Team)==HashInputValue then
- for _,GlowObj in pairs(self.GlowInstances[Character]) do
- GlowObj.Color3 = HashInputValue and self.FriendlyColor or (CamWrapper:CanSee(GlowObj.Adornee) and self.VisibleColor or self.EnemyColor)
- end
- end
- end
- end
- function ESP:TagChar(Player,Character)
- local OldCharacter = self.Characters[Player]
- if OldCharacter then
- local OldGlows = self.GlowInstances[OldCharacter]
- if OldGlows then
- for i,v in pairs(OldGlows) do
- v:Destroy()
- end
- end
- end
- self.Characters[Player]=Character
- local NewGlows = {}
- for i,v in pairs(Character:GetChildren()) do
- if v:IsA("BasePart") then
- local g = Instance.new("BoxHandleAdornment")
- g.Color3=self:CalculateColor(Player,v)
- g.Adornee=v
- g.AlwaysOnTop=true
- g.Size=v.Size
- g.ZIndex=1
- g.Visible=true
- g.Transparency=self.GlowTransparency
- g.Parent=workspace
- NewGlows[v]=g
- local event
- event = v.AncestryChanged:Connect(function()
- if not v:IsDescendantOf(workspace) then
- g:Destroy()
- event:Disconnect()
- end
- end)
- end
- end
- self.GlowInstances[Character]=NewGlows
- end
- function ESP:Update()
- if not self.Enabled then return end
- local UpdateColors = false
- if tick()-self.LastRay>1/ESPRate:GetValue() then
- UpdateColors=true
- self.LastRay=tick()
- end
- for i,Player in pairs(Players:GetPlayers()) do
- if Player~=LocalPlayer then
- local Char = Player.Character
- if Char ~= self.Characters[Player] then
- self:TagChar(Player,Char)
- end
- if UpdateColors then
- self:TickPlayer(Player,Char)
- end
- end
- end
- end
- ESP:Load()
- local Aimbot={}
- Aimbot.FrameCache={}
- function Aimbot:Load()
- self.Enabled = AimbotEnabled:GetValue()
- AimbotEnabled.ValueChanged.Event:Connect(function(Value)
- self.Enabled = Value
- end)
- self.Sens = AimSens:GetValue()
- AimSens.ValueChanged.Event:Connect(function(Value)
- self.Sens = Value
- end)
- self.Drop = AimbotCalcDrop:GetValue()
- AimbotCalcDrop.ValueChanged.Event:Connect(function(Value)
- self.Drop = Value
- end)
- self.Movement = AimbotCalcMovement:GetValue()
- AimbotCalcMovement.ValueChanged.Event:Connect(function(Value)
- self.Movement = Value
- end)
- end
- function Aimbot:Update(dT)
- local aimpart = AimBone:GetValue()
- local bulletspeed = bulletspeeds[activeslot]
- if self.Enabled and Aim then
- local closest,distance,player = nil,math.huge,nil
- for _,Player in pairs(Players:GetPlayers()) do
- local char = Player.Character
- if char and char:FindFirstChild(aimpart) and Player.Team ~= LocalPlayer.Team and char:IsDescendantOf(workspace) then
- local head = char[aimpart]
- DelayAction(function()
- self.FrameCache[Player] = {tick(),head.Position}
- end,0)
- local dVec = (CamWrapper.cam.CFrame.p-head.Position)*-1
- local ray = Ray.new(CamWrapper.cam.CFrame.p,dVec)
- local part,pos = workspace:FindPartOnRayWithIgnoreList(ray, {workspace.Ignore, LocalPlayer.Character, CamWrapper.cam})
- local angle = math.deg(math.acos(dVec.unit:Dot(CamWrapper.cam.CFrame.LookVector)))
- if (not part or part:IsDescendantOf(char)) and angle < AimLimit:GetValue() then
- --visibility check
- local distance2 = CamWrapper:CamAngleTo(head.Position)
- if distance2<distance then
- closest = head
- distance = distance2
- player=Player
- end
- --closest head logic
- end
- end
- end
- if closest then
- local traveltime = (closest.Position-CamWrapper.cam.CFrame.p).magnitude/bulletspeed
- local bufferDiff = Vector3.new()
- pcall(function()
- bufferDiff = (closest.Position - self.FrameCache[player][2])/(tick()-self.FrameCache[player][1]) or closest.Position
- end)
- --catch no cached player position error
- bufferDiff = bufferDiff * traveltime * 2 * (self.Movement and 1 or 0)
- local drop = Vector3.new(0,11,0)*traveltime*(self.Drop and 1 or 0)
- local screenPos,visible = CamWrapper.cam:WorldToScreenPoint(bufferDiff+closest.Position+drop)
- local mult = (visible and 1 or -1 ) * self.Sens * .5
- local mouse = LocalPlayer:GetMouse()
- local pos2d = Vector2.new(screenPos.X,screenPos.Y)
- --AimFrame.Position = UDim2.new(0,pos2d.X,0,pos2d.Y)
- local relativePos = pos2d-Vector2.new(mouse.ViewSizeX,mouse.ViewSizeY)/2
- local maxMag = math.min(relativePos.Magnitude, 150)
- relativePos = relativePos.unit * maxMag * mult
- MoveMouse(relativePos.X,relativePos.Y)
- end
- end
- end
- Aimbot:Load()
- game:GetService("RunService").RenderStepped:Connect(function(dT)
- CamWrapper:Update()
- ESP:Update()
- Aimbot:Update(dT)
- DelayEvaluate()
- end)
- Gui.DisplayOrder = 9999
Add Comment
Please, Sign In to add comment