its a 200 lines script feel free to choose if you want to analyze it or not
`local Event1 = game.ReplicatedStorage.RemotesEvents.CompetencesEquipeBleu
local TpPart = game.Workspace.Zone.TpPart
local PartBleu = game.Workspace.Equipes.PartBleu
local PartRouge = game.Workspace.Equipes.PartRouge
local BillboardGui = game.Workspace.Zone.Affichage.BillboardGui.TextLabel
local PrisoniersTable = {}
local JoueursEquipeRouge = {}
Event1.OnServerEvent:Connect(function(Player)
local HumanoidRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
local Hitbox = Instance.new("Part", workspace)
Hitbox.CFrame = HumanoidRootPart.CFrame * CFrame.new(0, 0, -1)
Hitbox.Size = Vector3.new(8,8,8)
Hitbox.CanCollide = false
Hitbox.Transparency = 0
local Woosh = Instance.new("Sound", HumanoidRootPart)
Woosh.SoundId = "rbxassetid://9041161094"
Woosh.Volume = 0.1
Woosh:Play()
local WeldConstraint = Instance.new("WeldConstraint", Hitbox)
WeldConstraint.Part0 = HumanoidRootPart
WeldConstraint.Part1 = Hitbox
Hitbox.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
print(Hit.Parent)
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
local EquipeBleuBool = Player.Valeurs.EquipeBleuBool
local PrisonierBool = Player.Valeurs.PrisonierBool
if EquipeBleuBool.Value == false then
if not table.find(PrisoniersTable, Player.Name) then
local VictimeHumanoidRootPart = Hit.Parent:FindFirstChild("HumanoidRootPart")
local VictimeHumanoid = Hit.Parent:FindFirstChild("Humanoid")
for _,v in pairs(game.Players:GetChildren()) do
if v.Valeurs.EquipeBleuBool.Value == false then
if not table.find(JoueursEquipeRouge, v.Name) then
table.insert(JoueursEquipeRouge, v.Name)
end
end
end
PrisonierBool.Value = true
table.insert(PrisoniersTable, Player.Name)
BillboardGui.Text = (#PrisoniersTable .. "/" .. #JoueursEquipeRouge)
VictimeHumanoidRootPart.CFrame = TpPart.CFrame
VictimeHumanoid.WalkSpeed = 16
local Sifflement = Instance.new("Sound", HumanoidRootPart)
Sifflement.SoundId = "rbxassetid://9117259635"
Sifflement.Volume = 0.05
Sifflement:Play()
end
end
end
end)
wait(0.1)
Hitbox:Destroy()
end)
game.Players.PlayerRemoving:Connect(function(Player)
if table.find(JoueursEquipeRouge, Player.Name) then
table.remove(PrisoniersTable, table.find(PrisoniersTable, Player.Name))
table.remove(JoueursEquipeRouge, table.find(JoueursEquipeRouge, Player.Name))
print(#JoueursEquipeRouge)
BillboardGui.Text = (#PrisoniersTable .. "/" .. #JoueursEquipeRouge)
end
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function()
local EquipeBleuBool = Player.Valeurs.EquipeBleuBool
if not table.find(JoueursEquipeRouge, Player.Name) then
if EquipeBleuBool.Value == false then
table.insert(JoueursEquipeRouge, Player.Name)
BillboardGui.Text = (#PrisoniersTable .. "/" .. #JoueursEquipeRouge)
local Humanoid = Player.Character:FindFirstChild("Humanoid")
local HumanoidRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
local Character = Player.Character
for _,Corp in pairs(Player.Character:GetChildren()) do
if Corp:IsA("Part") or Corp:IsA("BasePart") then
Corp.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
local Player1 = game.Players:GetPlayerFromCharacter(Hit.Parent)
local Character = Player1.Character
local HumanoidRootPart = Player1.Character:FindFirstChild("HumanoidRootPart")
local Humanoid = Player1.Character:FindFirstChild("Humanoid")
local PrisonierBool = Player1.Valeurs.PrisonierBool
if Player1.Name ~= Player.Name then
if PrisonierBool.Value == true then
if EquipeBleuBool.Value == false then
table.remove(PrisoniersTable, table.find(PrisoniersTable, Player1.Name))
BillboardGui.Text = (#PrisoniersTable .. "/" .. #JoueursEquipeRouge)
Humanoid.WalkSpeed = 25
end
end
end
end
end)
end
end
Humanoid.Died:Connect(function()
if table.find(PrisoniersTable, Player.Name) then
local Character = Player.Character
local HumanoidRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
print(Player.Name .. " tried to run away")
Player.CharacterAdded:Wait()
wait(3)
Player.Character:PivotTo(TpPart.CFrame)
end
end)
end
end
end)
end)
PartBleu.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild(“Humanoid”) then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if table.find(JoueursEquipeRouge, Player.Name) then
table.remove(JoueursEquipeRouge, table.find(JoueursEquipeRouge, Player.Name))
BillboardGui.Text = (#PrisoniersTable .. "/" .. #JoueursEquipeRouge)
end
end
end)
PartRouge.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild(“Humanoid”) then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if not table.find(JoueursEquipeRouge, Player.Name) then
table.insert(JoueursEquipeRouge, Player.Name)
BillboardGui.Text = (#PrisoniersTable .. "/" .. #JoueursEquipeRouge)
end
end
end)`