Help with "wait for players" script bug

i having this issue when there is more or equal to 3 players in-game, the first player that join the game (i think) cant move when the game starts.
any soutions? and also provide with footage

task.wait(1)
local Players = game.Players
local countdown = game.SoundService.cd.countdown
local gamestarted = game.ReplicatedStorage.Values.StartingGame
game.SoundService.cd.onhold:Play()
while true do
	task.wait(1)
	local PlayerInServer = #Players:GetPlayers()
	if PlayerInServer < 3 then
		for _, player in pairs(Players:GetPlayers()) do
			local character = player.Character
			if character then
				local humanoid = character:FindFirstChildOfClass('Humanoid')
				if humanoid then
					humanoid.WalkSpeed = 0
					player.Character:FindFirstChild("scripts").needed.Framework.ShiftToRun.Enabled = false
				end
			end
		end
	else
		local PlayerInServer = #Players:GetPlayers()
		if PlayerInServer >= 3 then
			for _, player in pairs(Players:GetPlayers()) do
				local character = player.Character
				if character then
					local humanoid = character:FindFirstChildOfClass('Humanoid')
					if humanoid then
						game.SoundService.cd.onhold:Stop()
						game.SoundService.cd.countdown:Play()
						wait(3)
						humanoid.WalkSpeed = 16
						player.Character.Framework.ShiftToRun.Enabled = true
						game.ReplicatedStorage.Values.StartingGame.Value = true
					end
				end
			end
		end
	end
	if gamestarted.Value == true then
		break
	end
end
1 Like

player.Character.Framework.ShiftToRun.Enabled = true

isnt it supposed to be

player.Character:FindFirstChild(“scripts”).needed.Framework.ShiftToRun.Enabled = true

1 Like

im checking it out right now to check if its working or not

1 Like

ok, so the run script dosent play and it keeps repeating itself

1 Like