The problem is that when I teleport the humanoidrootpart with CFrame when players stack (player-player collisions should be disabled, I say should because I can't test it because the bug occurs on real servers, not on local servers), this is the script
this is the teleport part
for i,v in pairs(game.Players:GetPlayers()) do
TheLight.leaderstats.money.Value = TheLight.leaderstats.money.Value + 75
v.leaderstats.money.Value = v.leaderstats.money.Value + 25
local LW = LightWins:Clone()
_G.LightK = 0
LW.Parent = v.PlayerGui
v.Character.HumanoidRootPart.CFrame = SpawnPart.CFrame
v.Team = game.Teams.Killed
Debounce2 = true
print("debouncing")
break
end
This is the whole script
GuiWall = workspace.Spawn.GuiPart
players = #game.Players:GetPlayers()
crashDelay = 0.0001
killDis = 5
winDetection = true
InGame = false
LightWins = workspace.GameScripts.Winsystem.TLW
RunnersWin = workspace.GameScripts.Winsystem.TRW
SpawnPart = workspace.GameScripts.SpawnPart
ready = false
ready2 = false
Debounce2 = true
serverStorage = game:WaitForChild("ServerStorage")
mainScript = serverStorage:WaitForChild("MainSecond")
while ready == false do
players = #game.Players:GetPlayers()
wait(crashDelay)
if players < 2 and InGame == false then
GuiWall.SurfaceGui.Players.Text = ("Players: "..tostring(#game.Players:GetPlayers()))
GuiWall.SurfaceGui.Red.Text = "Not enough players"
elseif players >= 2 and InGame == false then
GuiWall.SurfaceGui.Players.Text = ("Players: "..tostring(#game.Players:GetPlayers()))
GuiWall.SurfaceGui.Red.Text = "Waiting for a game to begin"
ready = true
end
end
GuiWall.SurfaceGui.Players.Text = "Starting in"
GuiWall.SurfaceGui.Red.TextColor3 = BrickColor.Green().Color
GuiWall.SurfaceGui.Red.Text = "10"
wait(1)
GuiWall.SurfaceGui.Red.Text = "9"
wait(1)
GuiWall.SurfaceGui.Red.Text = "8"
wait(1)
GuiWall.SurfaceGui.Red.Text = "7"
wait(1)
GuiWall.SurfaceGui.Red.Text = "6"
wait(1)
GuiWall.SurfaceGui.Red.Text = "5"
wait(1)
GuiWall.SurfaceGui.Red.Text = "4"
wait(1)
GuiWall.SurfaceGui.Red.Text = "3"
GuiWall.SurfaceGui.Red.TextColor3 = BrickColor.Red().Color
wait(.5)
GuiWall.SurfaceGui.Red.TextColor3 = BrickColor.Green().Color
wait(.5)
GuiWall.SurfaceGui.Red.Text = "2"
GuiWall.SurfaceGui.Red.TextColor3 = BrickColor.Red().Color
wait(.5)
GuiWall.SurfaceGui.Red.TextColor3 = BrickColor.Green().Color
wait(.5)
GuiWall.SurfaceGui.Red.Text = "1"
GuiWall.SurfaceGui.Red.TextColor3 = BrickColor.Red().Color
wait(1)
GuiWall.SurfaceGui.Red.Text = "Starting"
GuiWall.SurfaceGui.Players.Text = ""
wait(1)
GuiWall.SurfaceGui.Red.Text = "Game is currently in progress..."
GuiWall.SurfaceGui.Players.Text = ""
print("InGame")
--reset teams
for i,plr in pairs(game.Players:GetPlayers()) do
plr.Team = game.Teams.Runners
end
-- Teleport
TheLight = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
TheLight.Team = game.Teams.TheLight
for i,v in pairs(game.Teams.Runners:GetPlayers()) do
v.Character.HumanoidRootPart.CFrame = CFrame.new(52, 585.896, 3383)
end
for i,r in pairs(game.Teams.TheLight:GetPlayers()) do
r.Character.HumanoidRootPart.CFrame = CFrame.new(-267, 586, 3044)
wait()
r.Character.Humanoid.WalkSpeed = 0
wait(5)
r.Character.Humanoid.WalkSpeed = 16
end
ready2 = true
-- windetection
while winDetection == true do
wait(crashDelay)
_G.LightK = 1
LightPlrs = #game.Teams.TheLight:GetPlayers()
RunnersPlrs = #game.Teams.Runners:GetPlayers()
if LightPlrs == 0 and ready2 == true then
winDetection = false
print("The runners win")
for i,v in pairs(game.Players:GetPlayers()) do
v.leaderstats.money.Value = v.leaderstats.money.Value + 100
TheLight.leaderstats.money.Value = TheLight.leaderstats.money.Value - 75
local RW = RunnersWin:Clone()
RW.Parent = v.PlayerGui
_G.LightK = 0
v.Character.HumanoidRootPart.CFrame = SpawnPart.CFrame
v.Team = game.Teams.Killed
Debounce2 = true
print('Debouncing')
break
end
elseif RunnersPlrs == 0 and ready2 == true then
winDetection = false
print("The Light wins")
for i,v in pairs(game.Players:GetPlayers()) do
TheLight.leaderstats.money.Value = TheLight.leaderstats.money.Value + 75
v.leaderstats.money.Value = v.leaderstats.money.Value + 25
local LW = LightWins:Clone()
_G.LightK = 0
LW.Parent = v.PlayerGui
v.Character.HumanoidRootPart.CFrame = SpawnPart.CFrame
v.Team = game.Teams.Killed
Debounce2 = true
print("debouncing")
break
end
end
end
winDetection = false
GuiWall.SurfaceGui.Red.Text = "Resetting"
GuiWall.SurfaceGui.Players.Text = ""
wait(5)
GuiWall.SurfaceGui.Red.Text = "Wait"
GuiWall.SurfaceGui.Players.Text = "10"
wait(1)
GuiWall.SurfaceGui.Players.Text = "9"
wait(1)
GuiWall.SurfaceGui.Players.Text = "8"
wait(1)
GuiWall.SurfaceGui.Players.Text = "7"
wait(1)
GuiWall.SurfaceGui.Players.Text = "6"
wait(1)
GuiWall.SurfaceGui.Players.Text = "5"
for i,v in pairs(game.Players:GetPlayers()) do
v.Character.HumanoidRootPart.Position = SpawnPart.Position
end
wait(1)
GuiWall.SurfaceGui.Players.Text = "4"
wait(1)
GuiWall.SurfaceGui.Players.Text = "3"
wait(1)
GuiWall.SurfaceGui.Players.Text = "2"
wait(1)
GuiWall.SurfaceGui.Players.Text = "1"
wait(1)
GuiWall.SurfaceGui.Players.Text = ""
wait(1)
GuiWall.SurfaceGui.Red.Text = "Done!"
wait(2)
GuiWall.SurfaceGui.Red.Text = "Starting again"
wait(2)
Debounce2 = false
InGame = false
print("stats set")
main = mainScript:Clone()
main.Name = "MainScript"
main.Parent = workspace.GameScripts.ScriptCopy
wait()
script:Destroy()
