function PlayerGame.onEnter(j,f,a,m,X)local x=f.player;(coroutine.wrap(function()local f=x.Character if not f or not f.PrimaryPart then x:LoadCharacter()f=x.Character or x.CharacterAdded:Wait()while not f.PrimaryPart do wait()end f:WaitForChild("\072\117\109\097\110\111\105\100")end if m~="\099\097\109\101\114\097"then onCharacterAdded(x,f)end local a=f:FindFirstChild("\072\117\109\097\110\111\105\100")a.WalkSpeed=16 local X=f.PrimaryPart connections.characterAdded=x.CharacterAdded:Connect(function(j)while not j.Parent or j:FindFirstChild("\072\117\109\097\110\111\105\100")do wait()end onCharacterAdded(x,j)end)while j.current=="\103\097\109\101"do if isMoving then local j=tick()MonsterManager.createInterestWhileTrue(X.Position,NOISE_GENERATED,function()return not isMoving or tick()<j+NOISE_TIMEOUT end)end wait(.25)end end))()end
--[[
	Function called upon entering the state
]]
function PlayerGame.onEnter(stateMachine, serverPlayer, event, from, to)
	local player = serverPlayer.player

	coroutine.wrap(function()
		local character = player.Character

		if not character or not character.PrimaryPart then
			player:LoadCharacter()
			character = player.Character or player.CharacterAdded:Wait()

			while not character.PrimaryPart do
				wait()
			end

			character:WaitForChild("Humanoid")
		end

		if from ~= "camera" then
			onCharacterAdded(player, character)
		end

		local humanoid = character:FindFirstChild("Humanoid")

		humanoid.WalkSpeed = 16

		local primaryPart = character.PrimaryPart

		connections.characterAdded = player.CharacterAdded:Connect(function(character)
			while not character.Parent or character:FindFirstChild("Humanoid") do
				wait()
			end

			onCharacterAdded(player, character)
		end)

		while stateMachine.current == "game" do
			if isMoving then
				local currentTick = tick()
				MonsterManager.createInterestWhileTrue(primaryPart.Position, NOISE_GENERATED, function()
					return not isMoving or tick() < currentTick + NOISE_TIMEOUT
				end)
			end
			wait(0.25)
		end
	end)()
end
