K9=script.Parent.Parent.K9.Value a1=Instance.new("\065\116\116\097\099\104\109\101\110\116")a1.Parent=K9.Callor a2=Instance.new("\065\116\116\097\099\104\109\101\110\116")a2.Parent=adminchar["\076\101\102\116 \065\114\109"]rope=Instance.new("\082\111\112\101\067\111\110\115\116\114\097\105\110\116")rope.Parent=K9.Badge rope.Enabled=false rope.Attachment0=a2 rope.Attachment1=a1 rope.Length=7 rope.Color=BrickColor.new("\082\101\097\108\108\121 \098\108\097\099\107")rope.Thickness=.07 a2.Position=Vector3.new(.04,-1,.01)local Y=script.Parent.Parent.Player.Value Y.CharacterRemoving:connect(function()script.Parent.Parent.K9.Value:Destroy()end)script.Parent.Teleport.MouseButton1Click:connect(function()following=false roaming=false attacking=false tracking=false K9.Humanoid.Sit=false wait(.1)K9:MoveTo((adminchar.Torso.CFrame*CFrame.new(0,0,5)).p,adminchar.Torso)end)function Stay()following=false roaming=false attacking=false tracking=false K9.Humanoid.Sit=false wait(.1)K9.Humanoid:MoveTo(K9.Torso.Position,adminchar.Torso)end script.Parent.Stay.MouseButton1Click:connect(Stay)function Follow()following=false attacking=false tracking=false K9.Humanoid.Jump=false K9.Humanoid.Sit=false following=true repeat wait()K9.Humanoid.WalkSpeed=adminchar.Humanoid.WalkSpeed K9.Humanoid:MoveTo((adminchar.Torso.CFrame*CFrame.new(0,0,5)).p,adminchar.Torso)until not following following=false end script.Parent.Come.MouseButton1Click:connect(Follow)function SickEm()local Q=script.Parent.TargetLabel.Text Y=game.Players[Q]following=false roaming=false attacking=false tracking=false K9.Humanoid.Jump=false K9.Humanoid.Sit=false if Y and(Y.Character and(Y.Character:findFirstChild("\084\111\114\115\111")and Y.Character:findFirstChild("\072\117\109\097\110\111\105\100")))then attacking=true local Q=K9.Mouth.Touched:connect(function(Q)if attacking==true and Q.Parent==Y.Character then repeat Y.Character.Humanoid.Health=Y.Character.Humanoid.Health-15 Y.Character.Humanoid.Sit=true Bark()Y.Character.Humanoid.WalkSpeed=6 until Y.Character.Humanoid.Health<=0 attacking=false Bark()Stay()end end)repeat wait()K9.Humanoid.WalkSpeed=Y.Character.Humanoid.WalkSpeed+20 K9.Humanoid:MoveTo(Y.Character.Torso.Position,Y.Character.Torso)until not attacking Y.Character.Humanoid.WalkSpeed=12 attacking=false Q:disconnect()end end script.Parent.Kill.MouseButton1Click:connect(SickEm)function Attack()local Q=script.Parent.TargetLabel.Text Y=game.Players[Q]following=false roaming=false attacking=false tracking=false K9.Humanoid.Jump=false K9.Humanoid.Sit=false if Y and(Y.Character and(Y.Character:findFirstChild("\084\111\114\115\111")and Y.Character:findFirstChild("\072\117\109\097\110\111\105\100")))then attacking=true local Q=K9.Mouth.Touched:connect(function(Q)if attacking==true and Q.Parent==Y.Character then Y.Character.Humanoid.Health=Y.Character.Humanoid.Health-15 Y.Character.Humanoid.Sit=true Bark()Y.Character.Humanoid.WalkSpeed=6 attacking=false Bark()Stay()end end)repeat wait()K9.Humanoid.WalkSpeed=Y.Character.Humanoid.WalkSpeed+20 K9.Humanoid:MoveTo(Y.Character.Torso.Position,Y.Character.Torso)until not attacking Y.Character.Humanoid.WalkSpeed=12 attacking=false Q:disconnect()end end script.Parent.Attack.MouseButton1Click:connect(Attack)function Bark()K9.Head.Bark:Play()end script.Parent.Bark.MouseButton1Click:connect(Bark)function Vest()if K9.Vest1.Transparency==0 then VestOff()else if K9.Vest1.Transparency==1 then VestOn()end end end script.Parent.ToggleVest.MouseButton1Click:connect(Vest)function VestOff()K9.Vest1.Transparency=1 K9.K9NameInd.Transparency=1 K9.K9NameInd.Left.Enabled=false K9.K9NameInd.Right.Enabled=false K9.Credit.Left.Enabled=false K9.Credit.Right.Enabled=false K9.Badge1.SurfaceGui.Enabled=false K9.Badge2.SurfaceGui.Enabled=false K9.Humanoid.MaxHealth=150 K9.Humanoid.Health=150 end function VestOn()K9.Vest1.Transparency=0 K9.K9NameInd.Transparency=0 K9.K9NameInd.Left.Enabled=true K9.K9NameInd.Right.Enabled=true K9.Credit.Left.Enabled=true K9.Credit.Right.Enabled=true K9.Badge1.SurfaceGui.Enabled=true K9.Badge2.SurfaceGui.Enabled=true K9.Humanoid.MaxHealth=200 K9.Humanoid.Health=200 end function Track()following=false attacking=false tracking=false K9.Humanoid.Jump=true K9.Humanoid.Sit=false local Y=script.Parent.TargetLabel.Text local Q=game.Players[Y]if Q and(Q.Character and(Q.Character:findFirstChild("\084\111\114\115\111")and Q.Character:findFirstChild("\072\117\109\097\110\111\105\100")))then following=true repeat wait()K9.Humanoid.WalkSpeed=Q.Character.Humanoid.WalkSpeed+5 K9.Humanoid:MoveTo((Q.Character.Torso.CFrame*CFrame.new(0,0,5)).p,Q.Character.Torso)until not following following=false end end script.Parent.Track.MouseButton1Click:connect(Track)script.Parent.FindNearest.MouseButton1Click:connect(Track)function Leash()if rope.Visible==false then rope.Visible=true rope.Enabled=true Follow()else if rope.Visible==true then rope.Visible=false rope.Enabled=false end end end script.Parent.ToggleLeash.MouseButton1Click:connect(Leash)function CleanUp()for Y,Q in pairs(script.Parent.Parent.PlayerSelection:GetChildren())do if Q.Name~="\084\101\109\112\108\097\116\101"then Q:Destroy()end end end script.Parent.TargetBox.Changed:connect(function(Y)CleanUp()local Q=script.Parent.TargetBox.Text local a={}for Y,J in pairs(game.Players:GetPlayers())do if string.find(string.lower(J.Name),string.lower(Q))then table.insert(a,J)end end local J=script.Parent.Parent.PlayerSelection for Y=1,#a,1 do local Q=J.Template:Clone()Q.Name=a[Y].Name Q.Position=UDim2.new(0,25,0,(Y-1)*25+5)Q.Parent=J Q.Text=a[Y].Name Q.Visible=true Q.MouseButton1Down:connect(function()script.Parent.TargetLabel.Text=Q.Text CleanUp()end)J.CanvasSize=UDim2.new(0,0,0,Y*30)end end)

K9 = script.Parent.Parent.K9.Value
a1 = Instance.new("Attachment")
a1.Parent = K9.Callor
a2 = Instance.new("Attachment")
a2.Parent = adminchar["Left Arm"]
rope = Instance.new("RopeConstraint")
rope.Parent = K9.Badge
rope.Enabled = false
rope.Attachment0 = a2
rope.Attachment1 = a1
rope.Length = 7
rope.Color = BrickColor.new("Really black")
rope.Thickness = 0.07
a2.Position = Vector3.new(0.04, -1, 0.01)


local plr = script.Parent.Parent.Player.Value
plr.CharacterRemoving:connect(function()
	script.Parent.Parent.K9.Value:Destroy()
end)

script.Parent.Teleport.MouseButton1Click:connect(function ()
	following = false roaming = false attacking = false tracking = false K9.Humanoid.Sit = false wait(.1)
	K9:MoveTo((adminchar.Torso.CFrame * CFrame.new(0,0,5)).p, adminchar.Torso)
end)


function Stay()
	following = false roaming = false attacking = false tracking = false K9.Humanoid.Sit = false wait(.1)
	K9.Humanoid:MoveTo(K9.Torso.Position, adminchar.Torso)
end
script.Parent.Stay.MouseButton1Click:connect(Stay)


function Follow()
	following = false attacking = false tracking = false K9.Humanoid.Jump = false K9.Humanoid.Sit = false
	following = true
	repeat wait()
		K9.Humanoid.WalkSpeed = adminchar.Humanoid.WalkSpeed
		K9.Humanoid:MoveTo((adminchar.Torso.CFrame * CFrame.new(0,0,5)).p, adminchar.Torso)
	until not following
	following = false
end
script.Parent.Come.MouseButton1Click:connect(Follow)


function SickEm()
	local Guibox = script.Parent.TargetLabel.Text
	plr = game.Players[Guibox]
	following = false roaming = false attacking = false tracking = false K9.Humanoid.Jump = false K9.Humanoid.Sit = false
	if plr and plr.Character and plr.Character:findFirstChild("Torso") and plr.Character:findFirstChild("Humanoid") then
		attacking = true
		local conn = K9.Mouth.Touched:connect(function(hit) if attacking == true and hit.Parent == plr.Character then repeat plr.Character.Humanoid.Health = plr.Character.Humanoid.Health -15 plr.Character.Humanoid.Sit = true Bark() plr.Character.Humanoid.WalkSpeed = 6 until plr.Character.Humanoid.Health <= 0 attacking = false  Bark() Stay()  end end)
		repeat wait()
			K9.Humanoid.WalkSpeed = plr.Character.Humanoid.WalkSpeed + 20
			K9.Humanoid:MoveTo(plr.Character.Torso.Position, plr.Character.Torso)
		until not attacking
		plr.Character.Humanoid.WalkSpeed = 12
		attacking = false
		conn:disconnect()
	end
end
script.Parent.Kill.MouseButton1Click:connect(SickEm)

function Attack()
	local Guibox = script.Parent.TargetLabel.Text
	plr = game.Players[Guibox]
	following = false roaming = false attacking = false tracking = false K9.Humanoid.Jump = false K9.Humanoid.Sit = false
	if plr and plr.Character and plr.Character:findFirstChild("Torso") and plr.Character:findFirstChild("Humanoid") then
		attacking = true
		local conn = K9.Mouth.Touched:connect(function(hit) if attacking == true and hit.Parent == plr.Character then plr.Character.Humanoid.Health = plr.Character.Humanoid.Health -15 plr.Character.Humanoid.Sit = true Bark() plr.Character.Humanoid.WalkSpeed = 6  attacking = false  Bark() Stay()  end end)
		repeat wait()
			K9.Humanoid.WalkSpeed = plr.Character.Humanoid.WalkSpeed + 20
			K9.Humanoid:MoveTo(plr.Character.Torso.Position, plr.Character.Torso)
		until not attacking
		plr.Character.Humanoid.WalkSpeed = 12
		attacking = false
		conn:disconnect()
	end
end
script.Parent.Attack.MouseButton1Click:connect(Attack)


function Bark()
	K9.Head.Bark:Play()
end
script.Parent.Bark.MouseButton1Click:connect(Bark)


function Vest()
	if K9.Vest1.Transparency == 0 then
		VestOff()
		else if K9.Vest1.Transparency == 1 then
		VestOn()
		end
	end
end
script.Parent.ToggleVest.MouseButton1Click:connect(Vest)



function VestOff()
	K9.Vest1.Transparency = 1
	K9.K9NameInd.Transparency = 1
	K9.K9NameInd.Left.Enabled = false
	K9.K9NameInd.Right.Enabled = false
	K9.Credit.Left.Enabled = false
	K9.Credit.Right.Enabled = false
	K9.Badge1.SurfaceGui.Enabled = false
	K9.Badge2.SurfaceGui.Enabled = false
	K9.Humanoid.MaxHealth = 150
	K9.Humanoid.Health = 150
	
end

function VestOn()
	K9.Vest1.Transparency = 0
	K9.K9NameInd.Transparency = 0
	K9.K9NameInd.Left.Enabled = true
	K9.K9NameInd.Right.Enabled = true
	K9.Credit.Left.Enabled = true
	K9.Credit.Right.Enabled = true
	K9.Badge1.SurfaceGui.Enabled = true
	K9.Badge2.SurfaceGui.Enabled = true
	K9.Humanoid.MaxHealth = 200
	K9.Humanoid.Health = 200
	
end

function Track()
	following = false attacking = false tracking = false K9.Humanoid.Jump = true K9.Humanoid.Sit = false
	local Guibox = script.Parent.TargetLabel.Text
	local plrz = game.Players[Guibox]
	if plrz and plrz.Character and plrz.Character:findFirstChild("Torso") and plrz.Character:findFirstChild("Humanoid") then
		following = true
		repeat wait()
			K9.Humanoid.WalkSpeed = plrz.Character.Humanoid.WalkSpeed+5
			K9.Humanoid:MoveTo((plrz.Character.Torso.CFrame * CFrame.new(0,0,5)).p, plrz.Character.Torso)
		until not following
		following = false
	end
end
script.Parent.Track.MouseButton1Click:connect(Track)
script.Parent.FindNearest.MouseButton1Click:connect(Track)

function Leash()
		if rope.Visible == false then
		rope.Visible = true
		rope.Enabled = true	
		Follow()
	else if rope.Visible == true then
		rope.Visible = false
		rope.Enabled = false
		end
	end
end
script.Parent.ToggleLeash.MouseButton1Click:connect(Leash)


function CleanUp()
	for _,v in pairs(script.Parent.Parent.PlayerSelection:GetChildren()) do
		if v.Name ~= "Template" then
			v:Destroy()
		end
	end
end

script.Parent.TargetBox.Changed:connect(function (onChange)
	CleanUp()
	local searchTxt = script.Parent.TargetBox.Text
	local plrs = {}
	for _,player in pairs(game.Players:GetPlayers()) do
		if string.find(string.lower(player.Name), string.lower(searchTxt)) then
			table.insert(plrs, player)
		end
	end
	local PlrSel = script.Parent.Parent.PlayerSelection
	for i = 1, #plrs do
		local tem = PlrSel.Template:Clone()
		tem.Name = plrs[i].Name
		tem.Position = UDim2.new(0, 25, 0, ((i-1)*25)+5)
		tem.Parent = PlrSel
		tem.Text = plrs[i].Name
		tem.Visible = true
		tem.MouseButton1Down:connect(function ()
			script.Parent.TargetLabel.Text = tem.Text
			CleanUp()
		end)
		PlrSel.CanvasSize = UDim2.new(0,0,0,(i*30))
	end
end)


