Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
BODYGUARDSV2
-- Synapse Decompiler
-- Purchase Here: https://brack4712.xyz/synapse/purchase
--// Controls
--// X = Summon a bodyguard
--// M = Change Types of bodyguards (Snipers, riflers) Sniper is the default
--// Q = Aim
--// C = Makes all the bodyguards disappear.
--// Click = Shoot (You have to aim at somebody for snipers, you don't have to for
the rifles)
plr = game:service'Players'.LocalPlayer
char = plr.Character
head = char.Head
mouse = plr:GetMouse()
sam = 0
char.Archivable = true
arms = nil
torso = nil
follow = false
current = nil
curfollow = nil
rifleshoot = false
targ, huma = nil,nil
--// points
point1 = Instance.new('Part', char)
point1.Anchored = false
point1.CanCollide = false
point1.Transparency = 1
point1.Size = Vector3.new(0.2,0.2,0.2)
Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
Weld.Part1 = point1
Weld.C1 = CFrame.new(10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
Weld.Part1 = point2
Weld.C1 = CFrame.new(-10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
--// points
--// Configuration
max = 15
max1 = 2
maxammo = 30
mode = "Snipers"
--//
snipers,riflers,welds = {},{},{}
skinc = {
'Rust',
'Cool yellow',
'Br. yellowish orange',
'Pastel yellow',
'CGA brown'
}
props = {
'HeadColor',
'LeftArmColor',
'RightArmColor',
'TorsoColor',
'RightLegColor',
'LeftLegColor'
}
snpr = char:Clone()
snpr.Name = ""
for _, a in pairs(snpr:children()) do
if a:IsA'CharacterMesh' or a:IsA'Accessory' or a:IsA'Shirt' or a:IsA'Pants'
then
a:Destroy()
end
end
snpr.Parent = nil
bg = Instance.new("BodyGyro", snpr.HumanoidRootPart)
bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
bg.Name = "FOLLOW"
bg.P = 10000
bg.D = 100
function sniper(pos)
if sam <= max - 1 then
local sniper = snpr:Clone()
local bodyc = sniper:FindFirstChildOfClass'BodyColors'
local skincolor = skinc[math.random(1,5)]
for _, a in pairs(props) do
bodyc[a] = BrickColor.new(skincolor)
end
sniper.Parent = char
sniper:MoveTo(pos)
sniper.Torso.CFrame = CFrame.new(sniper.Torso.Position, head.Position)
table.insert(snipers, sniper)
sam = sam + 1
end
end
function rifler(pos)
if sam <= max1 - 1 then
local rifler = snpr:Clone()
local bodyc = rifler:FindFirstChildOfClass'BodyColors'
local skincolor = skinc[math.random(1,5)]
for _, a in pairs(props) do
bodyc[a] = BrickColor.new(skincolor)
end
for _, a in pairs(rifler:GetDescendants()) do
if a:IsA'BodyGyro' then
a:Destroy()
end
end
rifler.Parent = char
rifler:MoveTo(pos)
rifler.Torso.CFrame = CFrame.new(rifler.Torso.Position, head.Position)
rifler:FindFirstChild'SNIPERSOUND'.Pitch = 1.2
rifle = rifler:FindFirstChild'Sniper'
rifle.Name = "Rifle"
rifle:FindFirstChildOfClass'SpecialMesh'.TextureId =
"rbxassetid://546505949"
rifle:FindFirstChildOfClass'SpecialMesh'.MeshId =
"rbxassetid://546505802"
rifle:FindFirstChildOfClass'SpecialMesh'.Scale = Vector3.new(0.2, 0.2,
0.2)
rifle:FindFirstChildOfClass'Weld'.C0 = CFrame.new(-.4,.6,1.6) *
CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
table.insert(riflers, rifler)
sam = sam + 1
end
end
function ray(a,b)
local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700)
local part, position = workspace:FindPartOnRay(ray, char, false, true)
game:GetService('Debris'):AddItem(beam, 0.1)
end
mouse.KeyDown:connect(function(k)
local key = k:lower()
if key == "x" then
follow = false
if mode == "Snipers" then
sniper(mouse.Hit.p)
elseif mode == "Riflers" then
rifler(mouse.Hit.p)
end
wait(.3)
if curfollow then
follow = true
elseif not curfollow then
follow = false
end
elseif key == "c" then
for _, a in pairs(char:children()) do
if a.Name == "" then
for i = 1,10 do
a:FindFirstChild'HumanoidRootPart'.CFrame =
a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0)
wait()
end
wait(.15)
a:Destroy()
sam = sam - 1
end
end
elseif key == "m" then
if mode == "Snipers" then
mode = "Riflers"
elseif mode == "Riflers" then
mode = "Snipers"
end
elseif key == "q" then
if not follow then
follow = true
curfollow = true
on = false
for i = 1, sam / 2 do
wait(.6)
local now
ypcall(function()
if mode == "Snipers" then
now = snipers[math.random(1,#snipers)]
elseif mode == "Riflers" then
now = riflers[math.random(1,#riflers)]
end
end)
for _, a in pairs(riflers) do
bg = Instance.new("BodyGyro", a.HumanoidRootPart)
bg.maxTorque = Vector3.new(math.huge, math.huge,
math.huge)
bg.Name = "FOLLOW"
bg.P = 10000
bg.D = 100
end
now.Head.Sound:Resume()
current = now.Head.Sound.SoundId
end
elseif follow then
for _, a in pairs(riflers) do
for _, b in pairs(a:GetDescendants()) do
if b:IsA'BodyGyro' then
b:Destroy()
end
end
end
follow = false
curfollow = false
end
end
end)
mouse.Button1Down:connect(function()
if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and
mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then
follow = false
local targ = mouse.Target
huma = targ.Parent:FindFirstChildOfClass'Humanoid'
for _, a in pairs(targ.Parent:children()) do
if a:IsA'ForceField' then
a:Destroy()
end
end
huma.MaxHealth = 100
huma.Name = "Humanoid"
if mode == "Snipers" then
for _, a in pairs(snipers) do
if a:FindFirstChild'HumanoidRootPart' then
wait(.2)
rootpart = a.HumanoidRootPart
snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
snd:Play()
ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position)
huma:TakeDamage(huma.MaxHealth/2/2/2)
end
end
follow = true
end
end
end)
mouse.Button1Down:connect(function()
if mode == "Riflers" then
rifleshoot = true
end
end)
mouse.Button1Up:connect(function()
if mode == "Riflers" then
rifleshoot = false
end
end)
while wait() do
ypcall(function()
riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position)
riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position)
end)
if follow then
if mode == "Snipers" then
for _, a in pairs(snipers) do
if a:FindFirstChild'HumanoidRootPart' then
rootpart = a.HumanoidRootPart
rootpart.FOLLOW.CFrame =
CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position
* Vector3.new(0,1,0))
rootpart.Parent:WaitForChild'Laser'.CFrame =
mouse.Hit
end
end
elseif mode == "Riflers" then
for _, a in pairs(riflers) do
if a:FindFirstChild'HumanoidRootPart' then
rootpart = a.HumanoidRootPart
ypcall(function() rootpart.FOLLOW.CFrame =
CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position
* Vector3.new(0,1,0)) end)
rootpart.Parent:WaitForChild'Laser'.CFrame =
mouse.Hit
end
end
end
end
if rifleshoot and follow and mouse.Target and mouse.Target.Parent then
local targ = mouse.Target
local huma = nil
if targ.Parent:FindFirstChildOfClass'Humanoid' then
huma = targ.Parent:FindFirstChildOfClass'Humanoid'
else
huma = nil
end
if huma ~= nil then
for _, a in pairs(riflers) do
if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0
then
wait(.02)
rootpart = a.HumanoidRootPart
snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
snd.Pitch = 80
snd:Resume()
ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position)
huma:TakeDamage(huma.MaxHealth/2/2/2/2/2)
end
end
else
for _, a in pairs(riflers) do
snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
snd.Pitch = 80
snd:Resume()
ray(a:FindFirstChild'Rifle',mouse.Hit.p)
end
end
end
end